Thursday, July 3, 2008

REST is better than all the REST

Representational State Transfer (REST) is by far the superior architecture when building web-based applications. What exactly is REST? Put simply, it is a means in which disparate software objects communicate state information to one another. REST can be used by practically any programming environment, and it is fast because it is lightweight.

The most powerful aspect of REST is that it is extremely easy to understand and use. By contrast, using SOAP (Simple Object Access Protocol) is anything but simple to use and understand. REST is most commonly used to access remote objects, similar to what SOAP is intended to do. Each object can be accessed using a URI for the object. An example REST URI might look something like:

/rest/user/2b0a369e-e537-11dc-aa0f-0019d2b28af0/

Here, the unique aspect of the URL is the trailing user identifier. Using REST, we can tell the URI what action we want to take place by specifying the HTTP method. The HTTP method represents the action we want to perform on the object (the URI). And we can pass parameters to these actions using the typical HTTP request approach.

Here are some examples of how you can use the HTTP method to manipulate remote objects using REST.

Using GET to retrieve an object:

/rest/user/2b0a369e-e537-11dc-aa0f-0019d2b28af0/

Using POST to update an object:

/rest/user/2b0a369e-e537-11dc-aa0f-0019d2b28af0?username=newname

Using PUT to create an object:

/rest/user/2b0a369e-e537-11dc-aa0f-0019d2b28af0?username=newname

Using DELETE to delete an object:

/rest/user/2b0a369e-e537-11dc-aa0f-0019d2b28af0/

Enomalism has a fully-featured REST API that will allow any client that has the necessary permissions defined, to access the entire Enomalism functionality.

No comments :

Post a Comment