Maintainer | ulf.lilleengen@gmail.com |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
License: BSD3
The CoAP client API is intended to provide the minimal building block needed for sending CoAP requests. The API exposes CoAP request and response types and handles all internal messaging details of the CoAP protocol.
Example:
client <- createClient (createUDPTransport socket) doRawRequest client (SockAddrInet 5683 0) (Request GET [UriPath path] Nothing True)
- data Request = Request {}
- data Client = Client {}
- data Method
- data Response = Response {}
- data ResponseCode
- = Created
- | Deleted
- | Valid
- | Changed
- | Content
- | BadRequest
- | Unauthorized
- | BadOption
- | Forbidden
- | NotFound
- | MethodNotAllowed
- | NotAcceptable
- | PreconditionFailed
- | RequestEntityTooLarge
- | UnsupportedFormat
- | InternalServerError
- | NotImplemented
- | BadGateway
- | ServiceUnavailable
- | GatewayTimeout
- | ProxyingNotSupported
- data Option
- type OptionString = ByteString
- data MediaType
- createClient :: Transport -> IO Client
Documentation
CoAP request.
Request | |
|
A client that can perform CoAP requests.
Client | |
|
Request Method
CoAP response.
data ResponseCode Source
CoAP response codes.
CoAP Option types.
type OptionString = ByteString Source
CoAP Option ByteString
Supported media types in CoAP RFC for ContentFormat
createClient :: Transport -> IO Client Source
Create a client using a given transport. This will spawn internal messaging threads making the client ready to send requests.