"Projiect Project2.exe raised exception class EIdHTTProtocolException with message 'HTTP/1.1 302 Object moved'.Process stoped. Use Step or Run to continue." 不知道什么原因?请大虾指教。
”302 Object Moved ”的意思是: This code indicates that the requested node is not maintained by the server. The response includes the new URL for that node. A response of this type is typically received in response to a request to a router.在上一個貼中有我写的用「WebBrowser1」発送的↓、 WebBrowser1.Navigate(SList.Strings[0],EmptyParam,EmptyParam,PostData,Headers); 因WebBrowser1会自動的変換http addr、所以不会出ERROR。建義你用「WebBrowser1」発送、用「IdHTTP1」取网页代码。
因此在上一個貼中己写出原因、只是你没看或当時没看明白而己、現在再給你写一遍。你的网页「自动发贴的功能」順序是:
「guest.asp」-> 「write.asp」-> 「guest.asp」
发贴時在「guest.asp」网页登録、把登録内容送給「write.asp」認証、
然後再返回「guest.asp」、因此网页代码在「guest.asp」中、而不是在「write.asp」
若从「write.asp」取网页代码就会出錯、因此把発送和取网页代码分成二部分做。try
{...}
IdHTTP1.Post('http://vote.inhe.net/guestbook/write.asp', postList); //発送
finally
Memo1.Lines.Text := IdHTTP1.Get('http://vote.inhe.net/guestbook/guest.asp?user=newsre'); //从「guest.asp」取网页代码
postList.Free;
end;
This code indicates that the requested node is not maintained by the server. The response includes the new URL for that node. A response of this type is typically received in response to a request to a router.在上一個貼中有我写的用「WebBrowser1」発送的↓、
WebBrowser1.Navigate(SList.Strings[0],EmptyParam,EmptyParam,PostData,Headers);
因WebBrowser1会自動的変換http addr、所以不会出ERROR。建義你用「WebBrowser1」発送、用「IdHTTP1」取网页代码。