下面是反回应答: HTTP/1.1 400 Bad Request Date: Thu, 25 Sep 2003 09:25:41 GMT Server: Apache/1.3.28 (Win32) mod_gzip/1.3.26.1a Connection: close Content-Type: text/html; charset=iso-8859-1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>400 Bad Request</TITLE> </HEAD><BODY> <H1>Bad Request</H1> Your browser sent a request that this server could not understand.<P> Request header field is missing colon separator.<P> <PRE> username=word&password=123</PRE> <P> <HR> <ADDRESS>Apache/1.3.28 Server at 193.119.128.6 Port 80</ADDRESS> </BODY></HTML>
HTTP/1.1 400 Bad Request
Date: Thu, 25 Sep 2003 09:25:41 GMT
Server: Apache/1.3.28 (Win32) mod_gzip/1.3.26.1a
Connection: close
Content-Type: text/html; charset=iso-8859-1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
Your browser sent a request that this server could not understand.<P>
Request header field is missing colon separator.<P>
<PRE>
username=word&password=123</PRE>
<P>
<HR>
<ADDRESS>Apache/1.3.28 Server at 193.119.128.6 Port 80</ADDRESS>
</BODY></HTML>
HTTP/1.1 405 Method not allowed
Date: Thu, 25 Sep 2003 12:03:07 GMT
Server: Microsoft-IIS/5.0
Vary: *
Allow: OPTIONS, TRACE, GET, HEAD
Content-Length: 3923
Content-Type: text/html
X-Cache: MISS from 193.119.128.6
Connection: close<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html dir=ltr><head>
<style>
a:link {font:8pt/11pt verdana; color:FF0000}
a:visited {font:8pt/11pt verdana; color:#4e4e4e}
</style><META NAME="ROBOTS" CONTENT="NOINDEX"><title>The page cannot be displayed</title><META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
</head>
另外一个工具是采用Visual Studio.NET提供的Microsoft Application Test工具进行脚本录制,然后按照录制的脚本构造请求头发送http请求。无论你采用socket或者是Wininet api或者是xmlhttp组件,只要你构造的http发送包和ie发送的请求包一模一样,服务器端是无法判断你采用何种手段链接到服务器端。
post请求一般会产生302重新定向,这是往往需要向返回应答包的loaction字段指出的url重新发送请求。
Date: Thu, 25 Sep 2003 12:03:07 GMT
Server: Microsoft-IIS/5.0
Vary: *
Allow: OPTIONS, TRACE, GET, HEAD......
这一段,是不是在说不允许post啊,会不会这个网站禁止使用socket的post呢?
Get /login.cgi?username=a&password=b
host:www.sina.com.cn
cookie; xxxxxxxx
.....
你最好先跟踪一下浏览器,看一下浏览器采用的发送方法。