OpenSim
|
Implementation of a generic REST client More...
Public Member Functions | |
RestClient (string url) | |
Instantiate a new RestClient More... | |
void | Dispose () |
void | AddResourcePath (string element) |
Add a path element to the query, e.g. assets More... | |
void | AddQueryParameter (string name, string value) |
Add a query parameter to the Url More... | |
void | AddQueryParameter (string name) |
Add a query parameter to the Url More... | |
Stream | Request () |
Perform a synchronous request More... | |
Stream | Request (IServiceAuth auth) |
Perform a synchronous request More... | |
Stream | Request (Stream src, IServiceAuth auth) |
IAsyncResult | BeginRequest (AsyncCallback callback, object state) |
Stream | EndRequest (IAsyncResult asyncResult) |
Protected Member Functions | |
virtual void | Dispose (bool disposing) |
Properties | |
string | RequestMethod [get, set] |
Web-Request method, e.g. GET, PUT, POST, DELETE More... | |
Implementation of a generic REST client
This class is a generic implementation of a REST (Representational State Transfer) web service. This class is designed to execute both synchronously and asynchronously.
Internally the implementation works as a two stage asynchronous web-client. When the request is initiated, RestClient will query asynchronously for for a web-response, sleeping until the initial response is returned by the server. Once the initial response is retrieved the second stage of asynchronous requests will be triggered, in an attempt to read of the response object into a memorystream as a sequence of asynchronous reads.
The asynchronisity of RestClient is designed to move as much processing into the back-ground, allowing other threads to execute, while it waits for a response from the web-service. RestClient itself can be invoked by the caller in either synchronous mode or asynchronous modes.
Definition at line 59 of file RestClient.cs.
|
inline |
Instantiate a new RestClient
url | Web-service to query, e.g. http://osgrid.org:8003 |
Definition at line 137 of file RestClient.cs.
|
inline |
Add a query parameter to the Url
name | Name of the parameter, e.g. min |
value | Value of the parameter, e.g. 42 |
Definition at line 195 of file RestClient.cs.
|
inline |
Add a query parameter to the Url
name | Name of the parameter, e.g. min |
Definition at line 215 of file RestClient.cs.
|
inline |
Add a path element to the query, e.g. assets
element | path entry |
Definition at line 182 of file RestClient.cs.
|
inline |
In case, we are invoked asynchroneously this object will keep track of the state
Definition at line 489 of file RestClient.cs.
|
inline |
Definition at line 156 of file RestClient.cs.
|
inlineprotectedvirtual |
Definition at line 162 of file RestClient.cs.
|
inline |
Definition at line 499 of file RestClient.cs.
|
inline |
Perform a synchronous request
Definition at line 329 of file RestClient.cs.
|
inline |
Perform a synchronous request
Definition at line 337 of file RestClient.cs.
|
inline |
|
getset |
Web-Request method, e.g. GET, PUT, POST, DELETE
Definition at line 235 of file RestClient.cs.