Public Member Functions | |
| RestClient (string url) | |
| Instantiate a new RestClient. | |
| void | AddResourcePath (string element) |
| Add a path element to the query, e.g. assets. | |
| void | AddQueryParameter (string name, string value) |
| Add a query parameter to the Url. | |
| void | AddQueryParameter (string name) |
| Add a query parameter to the Url. | |
| Stream | Request () |
| Perform a synchronous request. | |
| Stream | Request (Stream src) |
| IAsyncResult | BeginRequest (AsyncCallback callback, object state) |
| Stream | EndRequest (IAsyncResult asyncResult) |
Static Public Attributes | |
| static ManualResetEvent | _allDone = new ManualResetEvent(false) |
| This flag will help block the main synchroneous method, in case we run in synchroneous mode. | |
Properties | |
| string | RequestMethod [get, set] |
| Web-Request method, e.g. GET, PUT, POST, DELETE. | |
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.
| OpenSim::Framework::Communications::RestClient::RestClient | ( | string | url | ) | [inline] |
| void OpenSim::Framework::Communications::RestClient::AddResourcePath | ( | string | element | ) | [inline] |
Add a path element to the query, e.g. assets.
| element | path entry |
| void OpenSim::Framework::Communications::RestClient::AddQueryParameter | ( | string | name, | |
| string | value | |||
| ) | [inline] |
Add a query parameter to the Url.
| name | Name of the parameter, e.g. min | |
| value | Value of the parameter, e.g. 42 |
| void OpenSim::Framework::Communications::RestClient::AddQueryParameter | ( | string | name | ) | [inline] |
Add a query parameter to the Url.
| name | Name of the parameter, e.g. min |
| Stream OpenSim::Framework::Communications::RestClient::Request | ( | ) | [inline] |
Perform a synchronous request.
| Stream OpenSim::Framework::Communications::RestClient::Request | ( | Stream | src | ) | [inline] |
| IAsyncResult OpenSim::Framework::Communications::RestClient::BeginRequest | ( | AsyncCallback | callback, | |
| object | state | |||
| ) | [inline] |
| Stream OpenSim::Framework::Communications::RestClient::EndRequest | ( | IAsyncResult | asyncResult | ) | [inline] |
ManualResetEvent OpenSim::Framework::Communications::RestClient::_allDone = new ManualResetEvent(false) [static] |
This flag will help block the main synchroneous method, in case we run in synchroneous mode.
string OpenSim::Framework::Communications::RestClient::RequestMethod [get, set] |
Web-Request method, e.g. GET, PUT, POST, DELETE.
1.5.1