7
77902543
Unregistered / Unconfirmed
GUEST, unregistred user!
我想发送一段这样的数据给192.168.0.1:9999端口
POST /test.asp?id=123456&ps=654321&str=我来做测试HTTP/1.0.. Connection: keep-alive..Content-Type: application/x-www-form-urlencoded..Content-Length: 4284..Host: 192.168.0.1:9999..Accept: text/html, */*..Accept-Encoding: identity..User-Agent: Mozilla/3.0 (compatible;
Indy Library)
ServerUrl:= '192.168.0.1';
GrStr:='我来做测试';
Params := TStringList.Create;
Params.Add('/test.asp?id=123456&ps=654321&str='+GrStr ) ;
Params.Add('/test.asp?id==123456');
Params.Add('&h=123456');
Params.Add('&str='+GrStr);
idhttp1.Port :=9999;
idhttp1.Request.Connection :='keep-alive';
idhttp1.Request.ContentType :='application/x-www-form-urlencoded';
idhttp1.Request.Host :='192.168.0.1';
idhttp1.Request.Accept :='text/html, */*';
idhttp1.Request.AcceptEncoding :='identity';
idhttp1.Request.UserAgent :='Mozilla/3.0 (compatible;
Indy Library)';
TestStr:=idhttp1.Post(ServerUrl , Params );
//到了这里就Socket Error 10061错误了。。。
ServerUrl:= '/test.asp';
GrStr := 'id=123456&h=123456&str=我来做测试';
Params := TMemoryStream.Create;
Params.Write(GrStr[1], Length(GrStr));
TestStr:=idhttp1.Post(ServerUrl, Params);
//也试过用这样的,也不行
用的是Delphi7+默认的控件,都弄了好几天了,一直没成功,有用过的高手Help一下啊~~
POST /test.asp?id=123456&ps=654321&str=我来做测试HTTP/1.0.. Connection: keep-alive..Content-Type: application/x-www-form-urlencoded..Content-Length: 4284..Host: 192.168.0.1:9999..Accept: text/html, */*..Accept-Encoding: identity..User-Agent: Mozilla/3.0 (compatible;
Indy Library)
ServerUrl:= '192.168.0.1';
GrStr:='我来做测试';
Params := TStringList.Create;
Params.Add('/test.asp?id=123456&ps=654321&str='+GrStr ) ;
Params.Add('/test.asp?id==123456');
Params.Add('&h=123456');
Params.Add('&str='+GrStr);
idhttp1.Port :=9999;
idhttp1.Request.Connection :='keep-alive';
idhttp1.Request.ContentType :='application/x-www-form-urlencoded';
idhttp1.Request.Host :='192.168.0.1';
idhttp1.Request.Accept :='text/html, */*';
idhttp1.Request.AcceptEncoding :='identity';
idhttp1.Request.UserAgent :='Mozilla/3.0 (compatible;
Indy Library)';
TestStr:=idhttp1.Post(ServerUrl , Params );
//到了这里就Socket Error 10061错误了。。。
ServerUrl:= '/test.asp';
GrStr := 'id=123456&h=123456&str=我来做测试';
Params := TMemoryStream.Create;
Params.Write(GrStr[1], Length(GrStr));
TestStr:=idhttp1.Post(ServerUrl, Params);
//也试过用这样的,也不行
用的是Delphi7+默认的控件,都弄了好几天了,一直没成功,有用过的高手Help一下啊~~