本文整理自网络,侵删。
idhttp的用法
1)POST
function PostMethod(http: TIDhttp; URL: string; Params: TStringList): string;varRespData: TStringStream;beginRespData := TStringStream.Create('');trytryif http = nil thenExit;Http.Post(URL, Params, RespData);Result := RespData.DataString;http.Request.Referer := URL;exceptResult := '';Exit;end;finallyhttp.Disconnect;FreeAndNil(RespData);end;
2)GET
function GetMethod(http: TIDhttp; URL: string): string;varResp: TStringStream;beginResp := TStringStream.Create('');trytryHttp.Get(URL, Resp);Http.Request.Referer := URL;Result := Resp.DataString;exceptResult := '';Exit;end;finallyFreeAndNil(Resp);end;end;
end;
相关阅读 >>
Delphi 利用tidencodermime tiddecodermime 组件字符串加密解密
Delphi判断mssql数据库中表格是否存在? 如何批量创建表格?
Delphi opendialog1 savedialog1 默认路径
更多相关阅读请进入《Delphi》频道 >>