HTTP简介
基本概念:
- The Hypertext Transfer Protocol (HTTP): an application protocol for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web.
- Client-server model: a distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients.
- Request–response (or request–reply): one of the basic methods computers use to communicate with each other, in which the first computer sends a request for some data and the second computer responds to the request.
- REST (representational state transfer) is an architectural style used for web development.
Request Methods/Verbs(动词):
- GET: Send named resource from the server to the client. (获取)
- POST: Send client data into a server gateway application.(创建)
- PUT: Store data from client into a named server resource. (更新)
- DELETE: Delete the named resource from a server. (删除)
- HEAD: Send just the HTTP headers from the response for the named resource.
- OPTIONS
- TRACE
- CONNECT
Headers(头)
HTTP header fields are components of the header section of request and response messages in the Hypertext Transfer Protocol (HTTP).
- standard header fields
- non-standard header fields: prefixing the field name with X-
Status Code(状态码)
- 1xx Informational
- 2xx Success
- 3xx Redirection
- 4xx Client Error
- 5xx Server Error