Home  >  Article  >  Backend Development  >  How php parses http objects

How php parses http objects

(*-*)浩
(*-*)浩Original
2019-09-30 10:36:482831browse

php parses the six request methods of the HTTP protocol: get, head, put, delete, post

How php parses http objects

##GET: Request the specified page information and return the entity body.

HEAD: Only the header of the page is requested. (Recommended learning: PHP video tutorial)

POST: Requests the server to accept the specified document as a new subordinate entity to the identified URI.

PUT: The data transferred from the client to the server replaces the contents of the specified document.

DELETE: Request the server to delete the specified page.

get and post are more common. The GET request places the submitted data in the HTTP request protocol header

The data submitted by POST is placed in the entity data

Http protocol

HTTP is an application layer protocol, consisting of requests and responses, and is a standard client-server model. HTTP is a stateless protocol.

Request message example

How php parses http objects

GET /public/api/index?id=1 HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cache-Control: max-age=0
Connection: keep-alive
Host: 192.168.10.10:8088
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36

The above is the detailed content of How php parses http objects. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn