@yoshteq/ti365-ts-sdk
    Preparing search index...

    Class HttpsClient

    HTTPS 1.1 Client that establishes an connection over a websocket. This client uses WASM for the TLS Encryption, WASM Module will be lazy loaded when the constructor is called.

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a TLS Client over WebSocket

      Parameters

      • hostname: string

        Hostname HttpHeader

      • tlsSocketProvider: TlsWebSocketProvider

        A Class that can Create an TlsWebSocket to the correct target.

      Returns HttpsClient

    Properties

    socket: undefined | TlsWebSocket
    reader: undefined | SocketReader
    timeout: number
    debugEnabled: boolean

    set to debug HttpClient with console.log

    onVerifyTlsConnection: (socket: TlsWebSocket) => Promise<void>

    Hook method for double verify a connection aber the tls connection has been established.

    Type Declaration

      • (socket: TlsWebSocket): Promise<void>
      • Parameters

        • socket: TlsWebSocket

          the new opened tls connection.

        Returns Promise<void>

    hostname: string
    onResponse: (response: HttpResponse) => void

    Callback Method that gets the response bevor its processed by the user.

    onStatusChange: (status: HttpClientRequestStatus) => void

    Callback Method that propagates the status of a HTTP Connection.

    Methods

    • Builds the http Request String by parameter

      Parameters

      • method: string

        http method

      • url: string

        Uri

      • headers: HttpHeader[]

        Headers used in this request

      Returns string

      Complete request string

    • Waits for the WASM to be loaded, then starts the connection to the WebSocket after that tries to establish a tls connections.

      Returns Promise<void>

      a Promise that resolves after the TLS connection is established, and rejects in case of an error

    • Returns void

    • Parameters

      • name: string
      • value: string

      Returns void

    • Parameters

      • name: string
      • value: string

      Returns void

    • Returns HttpHeader[]

    • Parameters

      • name: string

      Returns void

    • Try to establish an Websocket connection threw the tls connection.

      Parameters

      • path: string

        Webserver path

      • Optionalprotocols: string[]

        optional list of protocols for this socket.

      Returns Promise<TunneledWebSocket>

    • Trigger a GET Request on the server.

      Parameters

      • path: string

        Path on the server, will be URL Encoded.

      Returns Promise<HttpResponse>

      HttpResponse

    post

    • post(path: string, data: string | ArrayBufferLike): Promise<HttpResponse>

      POST some Data to the server. Please be aware that some Servers may require you to set the "Content-Type" header. This will not be done automatically.

      Parameters

      • path: string

        URI Path (will be uri encoded)

      • data: string | ArrayBufferLike

        Binary data or String that should be send to the client.

      Returns Promise<HttpResponse>

      Response from the server

    • PUT some Data to the server. Please be aware that some Servers may require you to set the "Content-Type" header. This will not be done automatically.

      Parameters

      • path: string

        URI Path (will be uri encoded)

      • data: string | ArrayBufferLike

        Binary data or String that should be send to the client.

      Returns Promise<HttpResponse>

      Response from the server

    • DELETE some Data to the server. Please be aware that some Servers may require you to set the "Content-Type" header. This will not be done automatically.

      Parameters

      • path: string

        URI Path (will be uri encoded)

      • Optionaldata: string | ArrayBufferLike

        Binary data or String that should be send to the client.

      Returns Promise<HttpResponse>

      Response from the server

    • OPTIONS some Data to the server. Please be aware that some Servers may require you to set the "Content-Type" header. This will not be done automatically.

      Parameters

      • path: string

        URI Path (will be uri encoded)

      Returns Promise<HttpResponse>

      Response from the server

    • HEAD some Data to the server. Please be aware that some Servers may require you to set the "Content-Type" header. This will not be done automatically.

      Parameters

      • path: string

        URI Path (will be uri encoded)

      Returns Promise<HttpResponse>

      Response from the server

    • PATCH some Data to the server. Please be aware that some Servers may require you to set the "Content-Type" header. This will not be done automatically.

      Parameters

      • path: string

        URI Path (will be uri encoded)

      • data: string | ArrayBufferLike

        Binary data or String that should be send to the client.

      Returns Promise<HttpResponse>

      Response from the server

    • Parameters

      • method: string
      • path: string
      • Optionaldata: string | ArrayBufferLike

      Returns Promise<HttpResponse>