Bluestep JS Documentation
    Preparing search index...

    Class HttpRequester

    A stateful HTTP request builder. Configure the request, call doRequest(), then read response fields.

    Index

    Constructors

    Methods

    • Appends Base64-decoded content to the request body.

      Parameters

      • content: string

        Base64-encoded content to decode and append.

      Returns boolean

    • Appends content to the request body.

      Parameters

      • content: string

        Content to append.

      • Optionalcharset: string

        Character set for encoding.

      Returns boolean

    • Adds a request header (allows duplicate keys).

      Parameters

      • key: string

        Header name.

      • value: string

        Header value.

      Returns boolean

    • Adds a form parameter for POST requests.

      Parameters

      • key: string

        Parameter name.

      • Optionalvalue: string

        Parameter value.

      Returns boolean

    • Sets HTTP Basic authentication credentials.

      Parameters

      • username: string

        The username.

      • password: string

        The password.

      Returns boolean

    • Clears the current error. Returns true if an error was cleared.

      Returns boolean

    • Gets the connection timeout in milliseconds.

      Returns number

    • Sets the connection timeout in milliseconds.

      Parameters

      • timeout: number

      Returns void

    • Returns the response content length.

      Returns number

    • Executes the HTTP request. Returns true on success, false on failure.

      Returns boolean

    • Returns the current error message, or null if no error.

      Returns string

    • Returns the response filename.

      Returns string

    • Gets whether redirects are followed.

      Returns boolean

    • Sets whether redirects are followed.

      Parameters

      • follow: boolean

      Returns void

    • Gets the response content as a string.

      Parameters

      • Optionalcharset: string

        Character set for decoding, or "BASE64" to get Base64-encoded content.

      Returns string

    • Gets the response content as a download URL.

      Returns string

    • Gets the HTTP method.

      Returns string

    • Sets the HTTP method (GET, POST, PUT, HEAD, OPTIONS, DELETE, TRACE).

      Parameters

      • method: string

      Returns void

    • Returns the response MIME type.

      Returns string

    • Gets the read timeout in milliseconds.

      Returns number

    • Sets the read timeout in milliseconds.

      Parameters

      • timeout: number

      Returns void

    • Gets the request headers as a map.

      Returns { [key: string]: string }

    • Returns the HTTP response code.

      Returns number

    • Returns the response headers as a map.

      Returns { [key: string]: string }

    • Returns the HTTP response message.

      Returns string

    • Sets the request body content.

      Parameters

      • content: string

        The request body content.

      • Optionalcharset: string

        Character set for encoding.

      Returns boolean

    • Sets a request header, replacing any existing header with the same key.

      Parameters

      • key: string

        Header name.

      • value: string

        Header value. If null, removes the header.

      Returns boolean

    • Gets the request URL.

      Returns string

    • Sets the request URL.

      Parameters

      • url: string

      Returns void