HTTP is present here as an Application layer protocol . Understanding the Application layer protocol is critical because in many cases we use HTTP as a transport protocol. HTTP in soap is used as a transport protocol.
GET
, POST
, PUT
, there areDELETE
is the action defined on the resource. With these operations, we do not need to define what getxxx, Createxxx ...
server-side and customer-to-HTTP interaction for various libraries, servers, proxies, caches, and other tools with visibility . The visibility described here is an attribute of the HTTP protocol's off-the-go reuse.
The visibility of the protocol can produce the following characteristics:
Cache
When a response (Respones) related resource changes, the cached response is automatically invalidated.
Optimistic concurrency control
When concurrent writes occur, write requests based on outdated resources are blocked.
Content negotiation
For resources, you can choose different forms of presentation.
Security and Idempotent
A system HTTP operation can be repeatedly manipulated on resources.
If the protocol is not visible, it is not certain that the above characteristics exist.
To ensure the visibility of HTTP, HTTP uses the following means to achieve its goal:
-
Non-stateful interaction. HTTP does not require a previous request or response to determine the status of the current request or response.
Use the same interface method: Options, HEAD, GET, PUT, POST, DELETE, TRACE
Use The envelope format of the Mime-li ke to define different resource representations
Use the correct status code to indicate the request result
Security (Safety) and idempotent (Idempotency) HTTP methods
Safe-No side effects (side effect)
Idempotent-The client's duplicate request has the same effect
Method Safty Idempotency
Get Yes Yes
Head Yes Yes
Options Yes Yes
Put No Yes
Delete No Yes
Post No No
Protocol for the Restful Web service-http application Layer