Class ria.RestService

A JavaScript facade to a REST-ful web service. Calls to the service will be performed as asynchronous XMLHttpRequest calls.

Method Summary
Method Attributes Method Name and Description
ria.RestService.addProxy(path)
Sets the path to a proxy to use for cross-domain calls.
call(url)
Sends a GET request to the given URL
Constructs a URL that requests the given URL through any previously registered proxies.
ria.RestService.toProxyUrl(url)
Constructs a URL that requests the given URL through any previously registered proxies.
Constructor Detail
ria.RestService(env)
Creates a new RestService instance.
Parameters:
{ria.Environment} env
Evironment trhat this RestService instance operates in (optional).
Method Detail
<static> ria.RestService.addProxy(path)
Sets the path to a proxy to use for cross-domain calls. The proxy server is expected to be accessible within the same domain as the application invoking the cross-domain call. The target URL of the call will be appended as a URL-encoded parameter to the end of this path, to construct a same-domain call. An example for a valid path is /riaproxy/?url=.
Parameters:
{String} path
Path to the proxy application

{dojo.Deferred} call(url)
Sends a GET request to the given URL
Parameters:
url
URL of the service to be invoked
Returns:
{dojo.Deferred} Handle to manage the asynchronous method call

{String} makeXdSafe(url)
Constructs a URL that requests the given URL through any previously registered proxies. If no proxy has been registered, the given URL will be returned as is.
Parameters:
{String} url
An arbitrary URL
Returns:
{String} URL that requests the given URL through the previously registered proxy.

<static> {String} ria.RestService.toProxyUrl(url)
Constructs a URL that requests the given URL through any previously registered proxies. If no proxy has been registered, the given URL will be returned as is.
Parameters:
{String} url
An arbitrary URL
Deprecated:
use ria.RestService.makeXdSafe() instead.
Returns:
{String} URL that requests the given URL through the previously registered proxy.