# HttpClient **Repository Path**: suxuss_admin/http-client ## Basic Information - **Project Name**: HttpClient - **Description**: 基于CrossSocket封装的Http(s)Client,使用更加方便简单。 - **Primary Language**: Delphi - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-11-28 - **Last Updated**: 2025-05-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HttpClient #### 介绍 基于CrossSock封装的Http(s)客户端类。 使用示例: ``` var Quest:IHttpQuestBase; begin //使用工厂创建请求接口 Quest := HTTP.Execute; //设置请求地址 Quest.SetUrl('https://127.0.0.1/index') //设置请求方式 .SetMethod('POST') //设置Content-Type .HttpHeaders.SetContentType('application/x-www-form-urlencoded') //设置Body .HttpBodys.SetHttpBodyFormString('a=1&b=2') //执行请求 .Execute(nil,procedure(const AResponse: ICrossHttpClientResponse) begin if (AResponse <> nil) and (AResponse.Content <> nil) then begin Writeln(TUtils.GetString(AResponse.Content)); end else Writeln('HTTP GET failed'); end ); end; ```