有关IdHTTP1.Post解决思路
有关IdHTTP1.Post
我写了个有关留言板提交的小程序。
可是我怎么一IdHTTP1.Post 就出现这样的错误啊。
project project1.exe raised exception class eldsocketerror with message 'socket error # 10054 connection reset by peer :process stopped .
use step or run to continue.
主要程序如下
var
res,ret:Tstringstream;
begin
res:=Tstringstream.Create( ' ');
ret:=Tstringstream.Create( ' ');
res.WriteString( 'contacter=123& ');
res.WriteString( 'email=12312312& ');
res.WriteString( 'content=abcedfeeagadfasd ');
res.WriteString( 'button1=%CC%E1+%BD%BB ');
IdHTTP1.Request.Accept:= 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* ';
IdHTTP1.Request.Referer := ' http://www.gxlpsf.com/mssboard.asp ';
IdHTTP1.Request.AcceptLanguage:= 'zh-cn ';
IdHTTP1.Request.AcceptEncoding:= 'gzip, deflate ';
IdHTTP1.Request.UserAgent:= ' Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ';
IdHTTP1.Request.Host:= 'www.gxlpsf.com ';
IdHTTP1.Request.ContentLength:=74;
IdHTTP1.Request.Connection:= ' Keep-Alive ';
IdHTTP1.Request.CacheControl:= 'no-cache ';
IdHTTP1.Post( 'www.gxlpsf.com/mssboard.asp?atcion=save ' ,res,ret);
end;
------解决方案--------------------
idHTTP-> HTTPOptions < <hoKeepOrigProtocol
你看看是不是这个问题,id的post是 1.0的
我写了个有关留言板提交的小程序。
可是我怎么一IdHTTP1.Post 就出现这样的错误啊。
project project1.exe raised exception class eldsocketerror with message 'socket error # 10054 connection reset by peer :process stopped .
use step or run to continue.
主要程序如下
var
res,ret:Tstringstream;
begin
res:=Tstringstream.Create( ' ');
ret:=Tstringstream.Create( ' ');
res.WriteString( 'contacter=123& ');
res.WriteString( 'email=12312312& ');
res.WriteString( 'content=abcedfeeagadfasd ');
res.WriteString( 'button1=%CC%E1+%BD%BB ');
IdHTTP1.Request.Accept:= 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* ';
IdHTTP1.Request.Referer := ' http://www.gxlpsf.com/mssboard.asp ';
IdHTTP1.Request.AcceptLanguage:= 'zh-cn ';
IdHTTP1.Request.AcceptEncoding:= 'gzip, deflate ';
IdHTTP1.Request.UserAgent:= ' Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ';
IdHTTP1.Request.Host:= 'www.gxlpsf.com ';
IdHTTP1.Request.ContentLength:=74;
IdHTTP1.Request.Connection:= ' Keep-Alive ';
IdHTTP1.Request.CacheControl:= 'no-cache ';
IdHTTP1.Post( 'www.gxlpsf.com/mssboard.asp?atcion=save ' ,res,ret);
end;
------解决方案--------------------
idHTTP-> HTTPOptions < <hoKeepOrigProtocol
你看看是不是这个问题,id的post是 1.0的