Cisco C880 M5 Configuration Guide
60
5.1 REST
l
Different representations of the resources, for example, in different
languages or formats (HTML, JSON or XML)
The
representation
of a resource can refer to other resources. If a client
follows a link in a representation, it changes from one state to another.
l
Addressability
l
Statelessness
A REST message contains all of the information required by the server or client in
order to understand the message. Neither the server nor the application saves
state information between two messages. This is known as a stateless protocol –
each operation stands alone and is fully isolated from earlier operations.
l
Uniform interfaces via standard HTML functions (e.g. the HTTP methods GET,
PUT, POST, and DELETE).
l
Communication occurs on demand. The client is active and requests a
representation from a passive server or modifies a resource.
l
Status codes
Each time a request is sent to the server, the client must be informed about all
potential application scenarios. Specific status codes are used for this purpose. If,
for example, a request is confirmed with the HTML status code
201 - Created
,
this means that a new resource has been created. The table shows some HTML
status codes:
HTML status code
Meaning
HTML status code
Meaning
200
OK
400
Bad Request
201
Created
401
Unauthorized
202
Accepted
403
Forbidden
204
No Content
404
Not Found
HTML methods
The following table shows the HTTP methods generally used to implement RESTful
APIs. These methods can be used to request or change resources:
HTTP methods
Description
GET
1)
Requests the specified resource from the server. GET does not
cause any other side effects. The server's state is not changed.
For this reason, GET is considered to be secure.
POST
Inserts a new (sub)resource below the specified resource.
POST is not free from side effects. For example, database fields
can be changed or processes can be started on the server.