Header information: User-Agent 'header' => 'Content-type: application/x-www-form-urlencoded '. "". 'user-Agent: post test '. "". 'content-length :'. strlen ($ post_string) + 8,
Please explain the meaning of the above sentence
I know that the encrypted content length is no less than 8 bytes when the form is submitted.
Reply to discussion (solution)
1. application/x-www-form-urlencoded is a way to express the submission, which uses urlencode, that is, the submitted data is encrypted, the server needs decode to obtain data correctly.
2. User-Agent: A User Agent is a browser. its information includes hardware platform, system software, application software, and users' personal preferences.
3. content-length: content length. strlen ($ post_string) + 8 indicates the length of the post String + 8, that is, the minimum value is 8.
Content-type encoding method here is where the data submitted by application/x-www-form-urlencoded is encoded as name/value pair
Content-length refers to the size of post data.
For post requests, you must specify Content-type and Content-length.
The User-Agent is the User proxy. for example, my chrome User proxy "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) chrome/38.0.2125.104 Safari/537.36 "you entered here
Strlen ($ post_string) does not know what to do with the + 8