RequestInit
Initialization data for the request
Property
body
optional attributes;
the subject data of the request;
Legal types for attribute values are;null
cache
optional attributes;
the requested cache mode;
Legal types for attribute values are RequestCachecredentials
optional attributes
Define rules for sending cookies
The legal type of attribute value is RequestCredentialsheaders
optional attributes;
The header data of the request;
Legal types for attribute values are HeadersInitintegrity
optional attributes
the requested subresource;
The legal type of attribute value is string;keepalive
optional attributes;
Whether to keep alive; initiate multiple requests on the same TCP connection;
The legal type of attribute value is boolean;method
optional attributes;
the requested method;
Legal values are:
"GET""POST"
"PUT"
"DELETE"
"PATCH"
"OPTIONS"
"HEAD"
"CONNECT"
"TRACE"
mode
optional attributes;
Define the same-origin policy;
The type of attribute value is RequestModeredirect
optional attributes;
How to handle redirects
The attribute value is of type RequestRedirectreferrer
Priority
who initiated the request;
The type that the attribute refers to is string;referrerPolicy
optional attributes;
Set the referrer policy of the request;
The type of attribute value is ReferrerPolicysignal
optional attributes;
Set the termination signal of the request;
The type of attribute value is AbortSignal
or null;widow
optional attributes;
The window used to contact the association;
The attribute value can only be null;
Method
- none
Event
- none
Platform Compatibility
Property/Method/Event | Android | IOS | Desktop-Dev | Desktop |
---|---|---|---|---|
body | ✅ | ✅ | ✅ | X |
cache | ✅ | ✅ | ✅ | X |
credentials | ✅ | ✅ | ✅ | X |
headers | ✅ | ✅ | ✅ | X |
integrity | ✅ | ✅ | ✅ | X |
keepalive | ✅ | ✅ | ✅ | X |
method | ✅ | ✅ | ✅ | X |
mode | ✅ | ✅ | ✅ | X |
referrer | ✅ | ✅ | ✅ | X |
referrerPolicy | ✅ | ✅ | ✅ | X |
signal | ✅ | ✅ | ✅ | X |
widow | ✅ | ✅ | ✅ | X |