Class: HttpConnection

$k. HttpConnection

new $k.HttpConnection()

A single connection to a HTTP server.

Methods

asyncRequest(request)

Sends the requests in an asynchronous manner. Neither waits for sending the request nor for receiving the response.
Check the log file for errors (channel "javascript").

Name Type Description
request $k.HttpRequest
Since:
  • 5.2.2
Throws:
Type Description
URIError

If the URI is not allowed

authenticate(username, password)

Set the username and password

Name Type Description
username string
password string
Since:
  • 4.0.3

authenticateFromEncrypedAccount(encryptedAccount)

Set the username and password from a volume encrypted authenication string

Name Type Description
encryptedAccount string

Encrypted account (Base64 encoded string generated in the Admin-Tool)

Since:
  • 5.2.1

getResponse(request) : $k.HttpResponse

Sends the requests and returns a reponse

Name Type Description
request $k.HttpRequest
Deprecated
  • Use request()
    See:
    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

    proxyUseNegotiate()

    Use negotiate mechanism for authentication with the proxy

    Since:
    • 5.3.2

    request(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
    Since:
    • 5.3
    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

    setProxy(host, port, type, credentials)

    Set the proxy data to use for this connection: host, port, type, credentials

    Name Type Description
    host string optional

    name of the proxy host, if omitted deactivates proxy

    port number optional

    port of the proxy, default 3128

    type string optional

    type of the proxy http/https, default "http"

    credentials string optional

    encrypted account (base64 encoded string generated in the Admin-Tool)

    Since:
    • 5.3.2
    Throws:
    Type Description
    $k.exception.InvalidValue

    An argument has an invalid value

    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

    useNegotiate()

    Use negotiate mechanism for authentication

    Since:
    • 5.2.2