1,593
社区成员
发帖
与我相关
我的任务
分享
idhttp1.AllowCookies:=true;
idhttp1.HandleRedirects:=true;
idhttp1.CookieManager:=idcookiemanager1;
idhttp1.Request.Connection:='Keep-Alive';
idhttp1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon)';
idhttp1.Request.ContentType:='application/x-www-form-urlencoded';
idhttp1.Request.Accept:='image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, */*';
idhttp1.Request.AcceptEncoding:='gzip, deflate';
idhttp1.Request.CacheControl:='no-cache';
idhttp1.ReadTimeout:=30000;
idhttp1.HTTPOptions:=idhttp1.HTTPOptions+[hoKeepOrigProtocol];
idhttp1.ProtocolVersion:=pv1_1;
memo1.Text:=idhttp1.Get('http://www.xxx.com/login.php');
procedure TForm1.btn2Click(Sender: TObject);
var
strMsg:string;
sParams: TStringStream;
begin
sParams:=TStringStream.Create('username=xxx&password=xxx');
strMsg:=idhttp1.post('http://www.xxx.com/login.php',sParams);
memo1.Text:=strmsg;
end;
memo1.Text:=idhttp1.Get('http://www.xxx.com/list.php');