Saturday, September 13, 2014

REST

REST (Representational State Transfer)

REST uses web addresses (URIs) to access and manipulate resources using verbs (HTTP request methods)



Verbs (HTTP Request Methods)

HTTP 1.1 defines a set of verbs (or request methods) that indicate an action taken on a resource.

The HTTP verbs (POST/GET/PUT/DELETE) roughly correspond to traditional CRUD (create/read/update/delete) operations in a database or object-relational management (ORM) system.

The resources on the Web are retrieved or changed in much the same way that SQL or similar query language is used to access or modify records in a database.



Head method

The HEAD method is identical to GET except that the response does not include a response body.

At times when the salient information resides in the response header rather than the body, makes sense
to use a HEAD call rather than incurring additional overhead of returning the response body through a standard GET.

Examples:

Cross-Origin Resource Sharing (CORS) returns JSON otherwise forbidden due to browser’s same origin security policy. It manages its negotiations with servers through HTTP headers.


Options method

The HTTP OPTIONS method can be used to retrieve a listing of HTTP request methods available for a resource.

Uniform Resource Identifiers

Uniform Resource Name (URN) : represents the name of a resource

Uniform Resource Locator (URL) : represents the address of a resource

General Syntax:

<scheme>://<user>:<password>@<host>:<port>/<path>;<parameters>?<query key/value pairs>#<fragment identifier>






No comments:

Post a Comment