Log on to a Web site by WinForm simulated post requests and get requests

Source: Internet
Author: User
Tags header http request log


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>  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.