How to send a few simple http requests with TCP
Today, I will talk to you about how to use TCP to send a few simple http requests, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Use the TCP debug assistant or telnet, both of which make you stand on the shoulders of the giant tcp.
The simplest http request is:
GET / HTTP/1.1
Host: www.baidu.com
Note that you need to add two blank lines at the end to represent a complete http request, the first blank line identifying the separation between head and body, and the second blank line indicating that body is empty.
You can also add other headfields, such as:
Referer: http://hongchangfirst/
The response can be:
HTTP/1.1 200 OK
Server: nginx/0.7.68
Date: Tue, 26 Feb 2013 02:34:44 GMT
Content-Type: text/html; charset=utf-8
Content-Length:35
Connection: keep-alive
Hongchangfirst is your best friend.
After reading the above, do you have any further understanding of how to send a few simple http requests using TCP? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.