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>;
}
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
Readonlybase URL
baseURL: string
Readonlyclient Ip
clientIp: string
Readonlyclient Web Server
clientWebServer: number
Readonlyheaders
headers: Headers
Readonlylocal Path
localPath: string
Readonlymethod
The method read-only property of the POST, etc.) A String indicating the method of the request.
Readonlyurl
url: string
The url read-only property of the Request interface contains the URL of the request.
Methods
blob
Returns Promise<Blob>
encode For Transfer
Returns { transferList: Transferable[]; value: WebRequestTransferData }
get All Cookies
This returns all the cookies originally sent by the client. They are not decrypted.
Returns Record<string, string>
- The cookies
get Cookie
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
- name: string
get Debug Settings
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 }
get Origin URL
Parameters
- pathname: string
Returns string | null
json
Returns Promise<unknown>
text
Returns Promise<string>
The
headersread-only property of the with the request.MDN Reference