Class “Request”
Object > Request
Represents an HTTP Request as used by fetch()
.
Type: |
Request extends Object |
Constructor: |
public |
Singleton: |
No |
Namespace: |
global |
Direct subclasses: |
None |
JSX Support: |
No |
Constructor
Parameter |
Type |
Description |
input |
string | Request |
|
init |
object |
Optional. |
init.body |
Blob | FormData | string |
The body of the request. GET or HEAD requests can not have a body. Optional. |
init.cache |
string |
Optional. |
init.credentials |
string |
Optional. |
init.headers |
Headers | Array<[string, string]> | {[header]: string} |
The headers to add to the request. Optional. |
init.method |
string |
The request method, e.g., 'GET' , 'POST' . Optional. |
init.mode |
string |
Optional. |
Methods
arrayBuffer()
Returns: Promise<ArrayBuffer>
blob()
Returns: Promise<Blob>
clone()
Returns: Request
json()
Returns: Promise<any>
text()
Returns: Promise<string>
Properties
bodyUsed
cache
context
credentials
method
mode
referrer
url