function Http.Get(const Url,Header,Params,RequestEncoding,ResponseEncoding:String;Timeout:Integer):String;
function Http.Delete(const Url,Header,Params,RequestEncoding,ResponseEncoding:String;Timeout:Integer):String;
function Http.Put(const Url,Header,Params,RequestEncoding,ResponseEncoding:String;Timeout:Integer):String;
function Http.Post(const Url,Header,Params,RequestEncoding,ResponseEncoding:String;Timeout:Integer):String;
function Http.Json(const Url,Header,Params,RequestEncoding,ResponseEncoding:String;Timeout:Integer):String;
Http.Get
属性与数据:
Request.URL : /ask/http_request.api
Request.RemoteIP : 0:0:0:0:0:0:0:1
Request.Method : GET
Request.Headers :
⨽ 1 : Connection | Keep-Alive
⨽ 2 : Content-Type | text/html; charset=utf-8;
⨽ 3 : User-Agent | HTTP Client of WebPascal
⨽ 4 : Host | localhost:8082
Request.Query :
⨽ 1 : id | 1
⨽ 2 : name | 刘德华
⨽ 3 : age | 18
⨽ 4 : pp | qq
⨽ 5 : aa | bb
Request.Params :
文件请使用 /upload 接口上传!
Http.Get GBK File
文件内容: 测a 5试
%E6%B5%8Ba%205%E8%AF%95
解码后: 测a 5试
测a 5试
Http.Get UTF-8 File
文件内容: 测a 5试
%B2%E2a%205%CA%D4
解码后: 测a 5试
测a 5试
Http.Delete
属性与数据:
Request.URL : /ask/http_request.api
Request.RemoteIP : 0:0:0:0:0:0:0:1
Request.Method : DELETE
Request.Headers :
⨽ 1 : Connection | Keep-Alive
⨽ 2 : Content-Type | text/html; charset=utf-8;
⨽ 3 : User-Agent | HTTP Client of WebPascal
⨽ 4 : Host | localhost:8082
Request.Query :
⨽ 1 : id | 1
⨽ 2 : name | 刘德华
⨽ 3 : age | 18
⨽ 4 : pp | qq
⨽ 5 : aa | bb
Request.Params :
文件请使用 /upload 接口上传!
Http.Put
属性与数据:
Request.URL : /ask/http_request.api
Request.RemoteIP : 0:0:0:0:0:0:0:1
Request.Method : POST
Request.Headers :
⨽ 1 : Connection | Keep-Alive
⨽ 2 : Content-Type | application/x-www-form-urlencoded; charset=utf-8
⨽ 3 : User-Agent | HTTP Client of WebPascal
⨽ 4 : Content-Length | 44
⨽ 5 : Host | localhost:8082
Request.Query :
⨽ 1 : pp | qq
⨽ 2 : aa | bb
Request.Params :
⨽ 1 : id | 1
⨽ 2 : name | 刘德华
⨽ 3 : age | 18
⨽ 4 : pp | qq
⨽ 5 : aa | bb
Http.Post (Form)
属性与数据:
Request.URL : /ask/http_request.api
Request.RemoteIP : 0:0:0:0:0:0:0:1
Request.Method : POST
Request.Headers :
⨽ 1 : Connection | Keep-Alive
⨽ 2 : Content-Type | application/x-www-form-urlencoded; charset=utf-8
⨽ 3 : User-Agent | HTTP Client of WebPascal
⨽ 4 : Content-Length | 44
⨽ 5 : Host | localhost:8082
Request.Query :
⨽ 1 : pp | qq
⨽ 2 : aa | bb
Request.Params :
⨽ 1 : id | 1
⨽ 2 : name | 刘德华
⨽ 3 : age | 18
⨽ 4 : pp | qq
⨽ 5 : aa | bb
Http.JSON (Post JSON)
属性与数据:
Request.URL : /ask/http_request.api
Request.RemoteIP : 0:0:0:0:0:0:0:1
Request.Method : POST
Request.Headers :
⨽ 1 : Connection | Keep-Alive
⨽ 2 : Content-Type | application/json; charset=utf-8;
⨽ 3 : User-Agent | HTTP Client of WebPascal
⨽ 4 : Content-Length | 41
⨽ 5 : Host | localhost:8082
Request.Query :
⨽ 1 : pp | qq
⨽ 2 : aa | bb
Request.Params :
⨽ 1 : id | 8
⨽ 2 : Name | 刘德华
⨽ 3 : Age | 18
Http.FormData
上传文件
上传成功:/up/20260613/860816909023576064.jpg
上传表单
属性与数据:
Request.URL : /ask/http_request.api
Request.RemoteIP : 0:0:0:0:0:0:0:1
Request.Method : POST
Request.Headers :
⨽ 1 : Connection | Keep-Alive
⨽ 2 : Content-Type | multipart/form-data; boundary=-------Embt-Boundary--22411A8018F80885
⨽ 3 : User-Agent | HTTP Client of WebPascal
⨽ 4 : Content-Length | 326
⨽ 5 : Host | localhost:8082
Request.Query :
⨽ 1 : pp | qq
⨽ 2 : aa | bb
Request.Params :
⨽ 1 : id | 1
⨽ 2 : name | 刘德华
⨽ 3 : age | 18
Http.GetFile
获取文件(转存),不建议转存大文件,只适合图片、文档的转存
获取成功:/up/20260613/860816909086490624.jpg