GoldenGateBindings / com.fitbit.goldengate.bindings.coap / Endpoint / resource

resource

open fun <T> resource(path: String, parser: ByteArrayParser<T>): Single<T>

Convenience method for making a GET request to path and parsing it into a T

Parameters

T - The type of object expected to be returned from a GET request to path

path - The path to make a request for over CoAP

parser - An object that knows how to construct an object of type T from a ByteArray

Return
A Single that will emit either the response parsed into a T or an error.