"Content-Type: application/x-www-form-urlencoded"

解决方案 »

  1.   

    方法一:比较简单的数据头,在WIN98、NT4.0+VB6.0下运行成功。
    dim strSendHeader as string  '定义数据头变量
    dim iSendLength as string    ,定义发送的数据长度变量
    ‘以下是数据头的简单写法,包括一个发送的数据长度的变量
    strSendHeader = "POST /http://127.0.0.1/getresult.asp HTTP/1.1" & vbCrLf
    strSendHeader = strSendHeader & "Content-Type: application/x-www-form-urlencoded " & vbCrLf
    strSendHeader = strSendHeader & "Content-Length: " & iSendLength & vbCrLfInet.execute "http://127.0.0.1/getresult.asp" ,"POST",SendData,strSendHeader方法二、拦截IE发送的提交数据包,
    strHeader=http://127.0.0.1/getresult.asp & " HTTP/1.1" & vbCrLf _
                          & "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*" & vbCrLf _
                          & "Accept -Language: zh -cn" & vbCrLf _
                          & "Content-Type: application/x-www-form-urlencoded" & vbCrLf _
                          & "Accept -Encoding: gzip , deflate" & vbCrLf _
                          & "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)" & vbCrLf _
                          & "Host: " & 127.0.0.1 & vbCrLf _
                          & "Content-Length: " & iSendLength & vbCrLf _
                          & "Connection: close" & vbCrLf _
                          & "Cookie: xxxxxxxx" & vbCrLf & vbCrLf _
                          & RequestData & vbCrLf & vbCrLf