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.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:8833
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:8833
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:8833
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:8833
request.Query :
⨽ 1 : pp | qq
⨽ 2 : aa | bb
request.Params :
⨽ 1 : id | 8
⨽ 2 : Name | 刘德华
⨽ 3 : Age | 18
Http.FormData
上传文件
上传成功:/up/20251130/790187615528681472.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--746E4DE2316CD371
⨽ 3 : User-Agent | HTTP Client of WebPascal
⨽ 4 : Content-Length | 326
⨽ 5 : Host | localhost:8833
request.Query :
⨽ 1 : pp | qq
⨽ 2 : aa | bb
request.Params :
⨽ 1 : id | 1
⨽ 2 : name | 刘德华
⨽ 3 : age | 18
Http.GetFile
获取文件(转存),不建议转存大文件,只适合图片、文档的转存
获取成功:/up/20251130/790187615579013120.jpg