Java Socket POST request header, which is used to spell out the request string through socket

Source: Internet
Author: User

Ost/sys/login. aspx HTTP/1.1
HOST: www.vckbase.com
User-Agent: Mozilla/5.0 (windows; U; Windows NT 5.1; ZH-CN; RV: 1.9) Gecko/2008052906 Firefox/3.0
Accept: text/html, application/XHTML + XML, application/XML; q = 0.9, */*; q = 0.8
Accept-language: ZH-CN, ZH; q = 0.5
Accept-encoding: gzip, deflate
Accept-charset: gb2312, UTF-8; q = 0.7, *; q = 0.7
Keep-alive: 300
Connection: keep-alive
Referer: http://www.vckbase.com/
COOKIE: Maid = dommilabjopanjpnnakamcpk
Content-Type: Application/X-WWW-form-urlencoded
Content-Length: 79

Userid = aaaaaaa & Password = 01234567890 & gclsid = 501 & imagefield3.x = 43 & imagefield3.y = 11

 

It is important to note that there must be an empty line indicating that the request header ends. Otherwise, the server cannot determine whether the request header ends or not, leading to disconnection.
In addition, note that the Data Length value after Content-Length must be correct, that is, the length of the obtained data body part in bytes, this is the data corresponding to userid = aaaaaaa & Password = 01234567890 & gclsid = 501 & imagefield3.x = 43 & imagefield3.y = 11.

Related Article

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.