Request: 
POST /some/resource HTTP/1.1
Content-type: application/x-www-form-urlencoded0=example.getStateName&1=10023Response: 
HTTP/1.1 200 OK
Content-type: text/plainNew YorkHTTP x/www-form-urlencoded namedArgs getTeam
POST /some/resource HTTP/1.1
Content-type: application/x-www-form-urlencoded0=example.getTeam&state=New%20York&sport=BaseballHTTP/1.1 200 OK
Content-type: multipart/mixed, boundary=B--BYankees
--BMets
--BHTTP x/www-form-urlencoded unicode addUser
POST /some/resource HTTP/1.1
Content-type: application/x-www-form-urlencoded0=example.addUser&fname=Igna%ACio&lname=SanchezHTTP with multipart/form-data
Request: 
POST /some/resource HTTP/1.1
Content-type: multipart/form-data, boundary=AaB03x--AaB03x
content-disposition: form-data; name="field1"Joe Blow
--AaB03x
content-disposition: form-data; name="pics"; filename="file1.gif"
Content-type: image/gif
Content-Transfer-Encoding: binary
...contents of file1.gif...
 --AaB03x--Response: 
HTTP/1.0 200 OK
Content-type: text/plainOKUploading multiple files with unicode
POST /foo HTTP/1.0
Content-type: multipart/form-data, boundary=AaB03x--AaB03x
content-disposition: form-data; name="field1"Joe Blow
--AaB03x
content-disposition: form-data; name="pics"
Content-type: multipart/mixed, boundary=BbC04y--BbC04y
Content-disposition: attachment; filename="file1.txt"
Content-Type: text/plain; charset=UNICODE-1-1
Content-Transfer-Encoding: binary... contents of some unicode file.txt ...
--BbC04y
Content-disposition: attachment; filename="file2.gif"
Content-type: image/gif
Content-Transfer-Encoding: binary...contents of file2.gif...
--BbC04y--
--AaB03x--XML and EMail
HTP Request 
POST /x/foo/bar HTTP/1.0
reply-to-url: [email protected]
message-id: abc123
aynch: required0=getAuthorization&1="bobjones"HTTP Response 
HTTP/1.0 200 OK
delivered-to: [email protected]
Content-length: 0
Mail/SMTP Response 
To: [email protected]
From: [email protected]
in-reply-to: abc123
content-type: text/xml<?xml version="1.0"?>
<this><is /><xml /></this>

解决方案 »

  1.   

    这个你可以直接使用HttpWebRequest类。如果你想用socket去写,你截取一下发送出去的字节,然后打印出来,就知道了。格式比较通用。
      

  2.   

    aspcn(飞刀) :是个办法,可是怎样用Socket窃取啊,我用的是一个线程侦听80,一运行就提示:
    未处理的“System.Net.Sockets.SocketException”类型的异常出现在 system.dll 中
    其他信息:通常每个套接字地址 (协议/网络地址/端口)
    只允许使用一次。
      

  3.   

    你把socket binding 到80断口了, 冲突
      

  4.   

    xdev(Gallant):请问如何才能获取80端口数据呀?
      

  5.   

    你80端口,可能被IIS占着了!在说,IE发送数据本地也不是80,服务器上才是80"工具"--"Internet选项"--"连接"中加上代理,设127.0.0.1,端口随便,就81,你再监听这就行了.
      

  6.   

    please search the soft ware "Effetech HTTP Sniffer",download it , then start ,it can do all of your want . the data ,the password in your intranet.
      

  7.   

    POST一般的格式是:varName1=Val1&varName2=Val2...没必要自己写程序来看格式吧?有很多工具可以做proxy并且输出请求格式的,比如TcpTrace和SoapToolkit里面的SoapTrace。