Skip to content

Request

Jim Schaad edited this page Jun 29, 2017 · 1 revision

Request Class

This class is used for creating arbitrary requests. For simple requests, it is easier to use the CoapClient especially if one is creating several different requests to a single target.

The Request class is derived from the Message class so all of the functions and properties of are inherited here.

Properties

EndPoint: Get/Set the endpoint to use for the message

Method: Get the request method.

Multicast: Get/Set if the request is a multicast request.

Response: Get the current response for the message if one exists.

ObserveReconnect: Get/Set if an observe should try and reconnect if the last response grows stale.

OscoapContext: Get/Set the context structure used to protect the request.

Session: Get the underlying communication session for the request.

TlsContext: Get the ISecureSession context for the TLS session if one exists.

URI: Get/Set the URI for the request

Action Lists

Respond: List of event handlers to trigger when a response to the message arrives.

Responding: List of event handlers to trigger when a partial response arrives in a blockwise transfer.

Reregistering: List of event handlers to trigger when the system is going to attempt to register for an observe resource.

Methods

GetParameter: Get the value of a query parameter.

MarkObseveCancel: Alias for the Observe property. Mark the request to cancel an observe relation.

MarkObserve: Alias for the Observe property. Mark the request as an observe request.

NewDelete: Create a new Delete request.

NewGet: Create new Get request.

NewPost: Create a new Post request.

NewPut: Create a new Put request.

Send: Send the request.

SetUri: An alias for the property URI. It allows one to set the URI for a request.

WaitForResponse: Wait for either a response or a time span to elapse.

Clone this wiki locally