All Bundles
HttpClient
HTTP client
Operations
Code example:
html := HttpClient->QuickGet(Url->New("http://worldtimeapi.org/api/ip"))->ToString();
if(html <> Nil) {
html->PrintLine();
};
New
Default constructor
New(cookies_enabled:Bool)
Parameters
Name | Type | Description |
---|
cookies_enabled | Bool | true if cookies are enabled, false otherwise |
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 | Url | URL |
Return
Performs a HTTP DELETE
method : public : Delete(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
content_type | String | content type |
Return
Performs a HTTP DELETE
method : public : Delete(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
data | Byte[] | data to post |
Return
Performs a HTTP DELETE
method : public : Delete(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
data | Byte[] | data to post |
content_type | String | content type |
Return
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 | Url | URL |
Return
Performs a HTTP GET
method : public : Get(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
content_type | String | content type |
Return
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
GetRequestHeaders
Gets the HTTP request headers
method : public : GetRequestHeaders() ~ Hash<String,String>
Return
GetResponseHeaders
Gets the HTTP response headers
method : public : GetResponseHeaders() ~ Hash<String,String>
Return
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 |
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 | Url | URL |
data | Byte[] | data to oper |
content_type | String | content type |
Return
Performs a HTTP POST
method : public : Post(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
data | Byte[] | data to post |
Return
Put
Performs a HTTP POST
method : public : Put(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
data | Byte[] | data to post |
Return
Performs a HTTP POST
method : public : Put(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
data | Byte[] | data to post |
content_type | String | content type |
Return
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 | Url | URL |
Return
Performs a HTTP DELETE and returns results as a String
function : QuickDelete(url:Web.HTTP.Url, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Return
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 | Url | URL |
content_type | String | content type |
Return
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
Return
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 | Url | URL |
data | Byte[] | data to post |
Return
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
Return
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 | Url | URL |
data | Byte[] | data to post |
content_type | String | content type |
Return
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
Return
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 | Url | URL |
Return
Performs a HTTP GET and returns results as a String
function : QuickGet(url:Web.HTTP.Url, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Return
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 | Url | URL |
content_type | String | content type |
Return
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
Return
QuickPost
Performs a HTTP POST
function : QuickPost(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
data | Byte[] | data to post |
Return
Performs a HTTPS POST
function : QuickPost(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
data | Byte[] | data to post |
content_type | String | content type |
Return
Performs a HTTP POST
function : QuickPost(url:Web.HTTP.Url, data:Byte[], content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Return
QuickPut
Performs a HTTP POST
function : QuickPut(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
data | Byte[] | data to post |
Return
Performs a HTTPS POST
function : QuickPut(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response
Parameters
Name | Type | Description |
---|
url | Url | URL |
data | Byte[] | data to post |
content_type | String | content type |
Return
Performs a HTTP POST
function : QuickPut(url:Web.HTTP.Url, data:Byte[], content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response
Parameters
Return
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 |