• 转: post 消息


    post 消息


    几个必要字段格式。


    C/C++ code
    "POST %s HTTP/1.1\r\n" \
    "Accept: */*\r\n" \
    "Content-Type: application/x-www-form-urlencoded\r\n" \
    "User-Agent: Mozilla/4.0 (compatible; MPUD %s)\r\n" \
    "Host: %s\r\n" \"Cache-Control: no-cache\r\n" \
    "Connection: Keep-Alive\r\n" \
    "Content-Length: %d\r\n" \
    "\r\n"
    "%s"


    我登录VCKBASE抓的包如下,注意换行符。


    C/C++ code
    POST /SYS/login/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: ASPSESSIONIDCSAATTCD=DOMMILABJOPANJPNNAKAMCPK
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 79


    userid=aaaaaaa&password=01234567890&gclsid=501&imageField3.x=43&imageField3.y=11


    POST /SYS/login/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: ASPSESSIONIDCSAATTCD=DOMMILABJOPANJPNNAKAMCPK
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 79


    userid=aaaaaaa&password=01234567890&gclsid=501&imageField3.x=43&imageField3.y=11


    24楼的这个就是例子。需要特别注意的是Content-Length后的数据长度值一定要正确,是获取的数据体部分的字节长度,具体就是 userid=aaaaaaa&password=01234567890&gclsid=501&imageField3.x=43&imageField3.y=11 这部分对应的数据。


    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/andylin02/archive/2008/10/24/3137357.aspx

  • 相关阅读:
    决策树详解
    快速排序python实现总结
    机器学习-主干学习路线梳理
    动态规划通用解法总结
    Ubuntu系统下环境安装遇到依赖冲突问题
    学习笔记----C语言的面向对象
    Linux下开发stm32--IDE篇
    Deepin中安装使用好用的字典GoldenDict
    python-参考书
    C语言-转义字符
  • 原文地址:https://www.cnblogs.com/cumtb3S/p/1758372.html
Copyright © 2020-2023  润新知