WebRequest | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Interface WebRequest

    interface WebRequest {
        baseURL: string;
        clientIp: string;
        clientWebServer: number;
        headers: Headers;
        localPath: string;
        method: HTTPMethod;
        url: string;
        blob(): Promise<Blob>;
        encodeForTransfer(): {
            transferList: Transferable[];
            value: WebRequestTransferData;
        };
        getAllCookies(): Record<string, string>;
        getCookie(name: string): string | null;
        getDebugSettings(): { flags: DebugFlags };
        getOriginURL(pathname: string): string | null;
        json(): Promise<unknown>;
        text(): Promise<string>;
    }

    Hierarchy

    • SupportedRequestSubset
      • WebRequest
    Index

    Properties

    baseURL: string
    clientIp: string
    clientWebServer: number
    headers: Headers

    The headers read-only property of the with the request.

    MDN Reference

    localPath: string
    method: HTTPMethod

    The method read-only property of the POST, etc.) A String indicating the method of the request.

    MDN Reference

    url: string

    The url read-only property of the Request interface contains the URL of the request.

    MDN Reference

    Methods

    • Returns Promise<Blob>

    • Returns { transferList: Transferable[]; value: WebRequestTransferData }

    • This returns all the cookies originally sent by the client. They are not decrypted.

      Returns Record<string, string>

      • The cookies
    • This returns a single cookie originally sent by the client. It is not decrypted.

      Parameters

      • name: string

        The name of the cookie

      Returns string | null

      • The cookie value or null if not found
    • The return value only contains the trusted flags set in this request (from both cookies and URL - either signed or part of the subset of flags that do not need a signature) You should normally use debugFlags from @webhare/env - request specific flags will be merged into this set for the current code context.

      Returns { flags: DebugFlags }

    • Parameters

      • pathname: string

      Returns string | null

    • Returns Promise<unknown>

    • Returns Promise<string>