Simple explanation of REST

A Bit About Basic REST

Source: https://cloud.google.com/resources/articles/google-cloud-endpoints-for-android

In REST, the basic idea is to expose the state of the system as a collection of individually addressable resources. You perform operations by manipulating these resources. A resource is an entity that has a state, as well as a name or id. Resources are stored in your backend—whether that is the Google Cloud Datastore, or something else.

As a general rule with REST, the client sees representations of the resources through requests made to the server. It can also update the resources by manipulating the representations, and sending the updated representations to the server via subsequent requests. Resources may be represented in a variety of ways: XML, JSON, CSV, or more. At this time, Cloud Endpoints only supports JSON, which tends to be less verbose and less vulnerable to human error than XML is.

You may have heard of CRUD (Create, Retrieve, Update, Delete), or variants of it. This is at the root of REST. When you use the Google Plugin for Eclipse to generate an Endpoint class, these types of basic methods are generated in the Endpoint class for you.

You are certainly not limited to those basic actions. Adding custom methods gives you much more flexibility, allowing you to perform complex operations. For example, checkForVictory might perform several queries, plus a write, to a database.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: