OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Member Functions | Properties | List of all members
OpenSim.Framework.RestClient Class Reference

Implementation of a generic REST client More...

Inheritance diagram for OpenSim.Framework.RestClient:
Inheritance graph
[legend]
Collaboration diagram for OpenSim.Framework.RestClient:
Collaboration graph
[legend]

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

OpenSim.Framework.RestClient.RestClient ( string  url)
inline

Instantiate a new RestClient

Parameters
urlWeb-service to query, e.g. http://osgrid.org:8003

Definition at line 137 of file RestClient.cs.

Member Function Documentation

void OpenSim.Framework.RestClient.AddQueryParameter ( string  name,
string  value 
)
inline

Add a query parameter to the Url

Parameters
nameName of the parameter, e.g. min
valueValue of the parameter, e.g. 42

Definition at line 195 of file RestClient.cs.

void OpenSim.Framework.RestClient.AddQueryParameter ( string  name)
inline

Add a query parameter to the Url

Parameters
nameName of the parameter, e.g. min

Definition at line 215 of file RestClient.cs.

void OpenSim.Framework.RestClient.AddResourcePath ( string  element)
inline

Add a path element to the query, e.g. assets

Parameters
elementpath entry

Definition at line 182 of file RestClient.cs.

IAsyncResult OpenSim.Framework.RestClient.BeginRequest ( AsyncCallback  callback,
object  state 
)
inline

In case, we are invoked asynchroneously this object will keep track of the state

Definition at line 489 of file RestClient.cs.

void OpenSim.Framework.RestClient.Dispose ( )
inline

Definition at line 156 of file RestClient.cs.

virtual void OpenSim.Framework.RestClient.Dispose ( bool  disposing)
inlineprotectedvirtual

Definition at line 162 of file RestClient.cs.

Stream OpenSim.Framework.RestClient.EndRequest ( IAsyncResult  asyncResult)
inline

Definition at line 499 of file RestClient.cs.

Stream OpenSim.Framework.RestClient.Request ( )
inline

Perform a synchronous request

Definition at line 329 of file RestClient.cs.

Stream OpenSim.Framework.RestClient.Request ( IServiceAuth  auth)
inline

Perform a synchronous request

Definition at line 337 of file RestClient.cs.

Here is the call graph for this function:

Stream OpenSim.Framework.RestClient.Request ( Stream  src,
IServiceAuth  auth 
)
inline

Definition at line 411 of file RestClient.cs.

Here is the call graph for this function:

Property Documentation

string OpenSim.Framework.RestClient.RequestMethod
getset

Web-Request method, e.g. GET, PUT, POST, DELETE

Definition at line 235 of file RestClient.cs.


The documentation for this class was generated from the following file: