Introduction
Recently, a friend asked how to simulate a POST request with WinForm, and then login to the site, a little thought, is roughly the HTTP message related to the package of information, and then request the Web site login address. Found in their blog on this part is not summed up, borrow this wind, summed up the relevant knowledge of HTTP message it.
HTTP definition
Hypertext Transfer Protocol (Http-hypertext Transfer Protocol) is a rule that details the communication between browsers and World Wide Web servers and transmits data transfer protocols for World Wide Web documents over the Internet.
The content of HTTP is no longer introduced here, the main analysis of HTTP message information.
HTTP message is divided into: Request message and Response message.
HTTP request message
An HTTP request message consists of 4 parts of the request line, the request header (header), the blank line, and the request data, and the request message format is as follows:
POST request
Get a simple login page, use AJAX to send a POST request, browse under IE, F12 analyze its request message:
Page code:
<! DOCTYPE html>