foo-webview-sdk
    Preparing search index...

    Interface HttpResponsePayload

    Payload of the http:response event. The outcome of an async http.get, http.post, http.put, http.delete, http.patch or http.head, carrying the receipt's requestId. On success it has the fields of the synchronous response; on failure error and code, like a failed call. Sent to the page that made the request, or to a page under the same top-level window when that one cannot be found, or else to the main window's page.

    interface HttpResponsePayload {
        body?: string;
        cancelled?: boolean;
        code?:
            | "INVALID_PARAMS"
            | "OPERATION_FAILED"
            | "CANCELLED"
            | "PERMISSION_DENIED";
        contentLength?: number;
        error?: string;
        headers?: Record<string, string>;
        requestId: string;
        responseType?: "text" | "base64";
        status?: number;
        success: boolean;
    }
    Index
    body?: string

    Response body, as text or Base64 according to responseType; always empty for http.head. Present on success.

    cancelled?: boolean

    true when the request was cancelled by http.abort; absent otherwise.

    code?: "INVALID_PARAMS" | "OPERATION_FAILED" | "CANCELLED" | "PERMISSION_DENIED"

    The error code: INVALID_PARAMS for a URL that is not http or https, PERMISSION_DENIED for a local or private network address the host setting does not allow, CANCELLED after http.abort, OPERATION_FAILED otherwise. Present on failure.

    contentLength?: number

    The Content-Length header as a number; present on success of http.head when the server sends one that parses.

    error?: string

    Why the request failed; present on failure.

    headers?: Record<string, string>

    Response headers by name; of repeated headers the last one wins. Present on success.

    requestId: string

    Id from the receipt.

    responseType?: "text" | "base64"

    text or base64, the encoding of body. Present on success.

    status?: number

    HTTP status code: on success that of the response; on failure only when a redirect was refused under redirect: "error", that of the redirect.

    success: boolean

    Whether a response came back. A response with an error status such as 404 is a success.