dojox/rpc/Rest (version 1.10)

Summary

This provides a HTTP REST service with full range REST verbs include PUT,POST, and DELETE.

A normal GET query is done by using the service directly:

var restService = dojox.rpc.Rest("Project");
restService("4");

This will do a GET for the URL "/Project/4".

restService.put("4","new content");

This will do a PUT to the URL "/Project/4" with the content of "new content".

You can also use the SMD service to generate a REST service:

var services = dojox.rpc.Service({services: {myRestService: {transport: "REST",...
services.myRestService("parameters");

The modifying methods can be called as sub-methods of the rest service method like:

services.myRestService.put("parameters","data to put in resource");
services.myRestService.post("parameters","data to post to the resource");
services.myRestService['delete']("parameters");

Usage

Rest(path,isJson,schema,getRequest);
Parameter Type Description
path String
isJson Boolean
Optional
schema Object
Optional
getRequest Function
Optional
Returns:function

See the dojox/rpc/Rest reference documentation for more information.

Property Summary

Method Summary

  • _change(method,service,id,serializedContent)
  • _get(service,id)

Properties

_index
Defined by: dojox/rpc/Rest
_timeStamps
Defined by: dojox/rpc/Rest

Methods

_change(method,service,id,serializedContent)
Parameter Type Description
method undefined
service undefined
id undefined
serializedContent undefined
_get(service,id)
Parameter Type Description
service undefined
id undefined
Error in the documentation? Can’t find what you are looking for? Let us know!