HttpClient
HTTP client
html := HttpClient->QuickGet(Url->New("http://worldtimeapi.org/api/ip"))->ToString();
if(html <> Nil) {
html->PrintLine();
};
Operations
- New
- AddHeader
- Delete
- EnableCookies
- Get
- GetCookie
- GetCookies
- GetRequestHeaders
- GetResponseHeaders
- HasCookie
- Post
- Put
- QuickDelete
- QuickGet
- QuickPost
- QuickPut
- RemoveHeader
- SetCookie
AddHeader
Adds a HTTP request header
method : public : AddHeader(name:String, value:String) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
name | String | header name |
value | String | header value |
Delete
Performs a HTTP DELETE
method : public : Delete(url:Web.HTTP.Url) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
Delete
Performs a HTTP DELETE
method : public : Delete(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
Delete
Performs a HTTP DELETE
method : public : Delete(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
Delete
Performs a HTTP DELETE
method : public : Delete(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
EnableCookies
Sets cookie support
method : public : EnableCookies(cookies_enabled:Bool) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
cookies_enabled | Bool | true if cookies are enabled, false otherwise |
Get
Performs a HTTP GET
method : public : Get(url:Web.HTTP.Url) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
Get
Performs a HTTP GET
method : public : Get(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
GetCookie
Get a cookie
method : public : GetCookie(name:String) ~ Cookie
Parameters
Name | Type | Description |
---|---|---|
name | String | cookie name |
Return
Type | Description |
---|---|
Cookie | found cookie, Nil otherwise |
GetCookies
Gets the cookies
method : public : GetCookies() ~ Vector<Cookie>
Return
Type | Description |
---|---|
Vector<Cookie> | vector of cookies |
GetRequestHeaders
Gets the HTTP request headers
method : public : GetRequestHeaders() ~ Hash<String,String>
Return
Type | Description |
---|---|
Hash<String,String> | HTTP request headers |
GetResponseHeaders
Gets the HTTP response headers
method : public : GetResponseHeaders() ~ Hash<String,String>
Return
Type | Description |
---|---|
Hash<String,String> | HTTP response headers |
HasCookie
Checks for a cookie
method : public : HasCookie(name:String) ~ Bool
Parameters
Name | Type | Description |
---|---|---|
name | String | cookie name |
Return
Type | Description |
---|---|
Bool | true if found cookie, false otherwise |
New
Default constructor
New(cookies_enabled:Bool)
Parameters
Name | Type | Description |
---|---|---|
cookies_enabled | Bool | true if cookies are enabled, false otherwise |
Post
Performs a HTTPS POST
method : public : Post(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to oper |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
Post
Performs a HTTP POST
method : public : Post(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
Put
Performs a HTTP POST
method : public : Put(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
Put
Performs a HTTP POST
method : public : Put(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | string read |
QuickDelete
Performs a HTTP DELETE and returns results as a String
function : QuickDelete(url:Web.HTTP.Url) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickDelete
Performs a HTTP DELETE and returns results as a String
function : QuickDelete(url:Web.HTTP.Url, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
headers | Map<String,String> | key/value headers |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickDelete
Performs a HTTP DELETE and returns results as a String
function : QuickDelete(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickDelete
Performs a HTTP DELETE and returns results as a String
function : QuickDelete(url:Web.HTTP.Url, content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
content_type | String | content type |
headers | Map<String,String> | key/value headers |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickDelete
Performs a HTTP DELETE and returns results as a String
function : QuickDelete(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickDelete
Performs a HTTP DELETE and returns results as a String
function : QuickDelete(url:Web.HTTP.Url, data:Byte[], headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
headers | Map<String,String> | key/value headers |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickDelete
Performs a HTTP DELETE and returns results as a String
function : QuickDelete(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickDelete
Performs a HTTP DELETE and returns results as a String
function : QuickDelete(url:Web.HTTP.Url, data:Byte[], content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
content_type | String | content type |
headers | Map<String,String> | key/value headers |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickGet
Performs a HTTP GET and returns results as a String
function : QuickGet(url:Web.HTTP.Url) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickGet
Performs a HTTP GET and returns results as a String
function : QuickGet(url:Web.HTTP.Url, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
headers | Map<String,String> | key/value headers |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickGet
Performs a HTTP GET and returns results as a String
function : QuickGet(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickGet
Performs a HTTP GET and returns results as a String
function : QuickGet(url:Web.HTTP.Url, content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
content_type | String | content type |
headers | Map<String,String> | key/value headers |
Return
Type | Description |
---|---|
Web.HTTP.Response | output buffer |
QuickPost
Performs a HTTP POST
function : QuickPost(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
Return
Type | Description |
---|---|
Web.HTTP.Response | read strings |
QuickPost
Performs a HTTPS POST
function : QuickPost(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | read strings |
QuickPost
Performs a HTTP POST
function : QuickPost(url:Web.HTTP.Url, data:Byte[], content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
content_type | String | content type |
headers | Map<String,String> | key/value headers |
Return
Type | Description |
---|---|
Web.HTTP.Response | read strings |
QuickPut
Performs a HTTP POST
function : QuickPut(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
Return
Type | Description |
---|---|
Web.HTTP.Response | read strings |
QuickPut
Performs a HTTPS POST
function : QuickPut(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
content_type | String | content type |
Return
Type | Description |
---|---|
Web.HTTP.Response | read strings |
QuickPut
Performs a HTTP POST
function : QuickPut(url:Web.HTTP.Url, data:Byte[], content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|---|---|
url | Web.HTTP.Url | URL |
data | Byte | data to post |
content_type | String | content type |
headers | Map<String,String> | key/value headers |
Return
Type | Description |
---|---|
Web.HTTP.Response | read strings |
RemoveHeader
Removes a HTTP request header
method : public : RemoveHeader(name:String) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
name | String | header name |
SetCookie
Sets a cookie
method : public : SetCookie(cookie:Cookie) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
cookie | Cookie | cookie |