new $k.HttpConnection()
A single connection to a HTTP server.
Methods
authenticate(username, password)
Set the username and password
Name | Type | Description |
---|---|---|
username |
String | |
password |
String |
- Since:
- 4.0.3
getResponse(request) : $k.HttpResponse
Sends the requests and returns a reponse
Only HTTP(S) requests are allowed. If the URI uses another protocol (e.g. 'file'), then an URIError is raised.
It is possible to restrict the domains that can be accessed by adding the following to the configuration file of a client (bridge etc.):
[script]
allowedOutgoingDomains=*.intelligent-views.com,ivinternal:8080
Name | Type | Description |
---|---|---|
request |
$k.HttpRequest |
Throws:
Type | Description |
---|---|
$k.exception.HttpError | If no response was received (timeout etc.) |
URIError | If the URI is not allowed |
Returns:
Type | Description |
---|---|
$k.HttpResponse | The response for the request |
setTimeout(timeout)
Set the timeout in milliseconds for connection to wait for reponses
Name | Type | Description |
---|---|---|
timeout |
number |
number of milliseconds to wait for reponses, default 20000 |
- Since:
- 4.2.0