Class WebRequest
Hierarchy
- WebRequest
Implements
Index
Properties
Accessors
Methods
Properties
Static Custom Request HeadersSearch playground for CustomRequestHeaders
Custom HTTP Request Headers to be sent with XMLHttpRequests i.e. when loading files, where the server/service expects an Authorization header
Type declaration
-
[key: string]: string
Static Custom Request ModifiersSearch playground for CustomRequestModifiers
Add callback functions in this array to update all the requests before they get sent to the network
Accessors
onprogress
-
Gets or sets a function to be called when loading progress changes
Returns ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null
-
Gets or sets a function to be called when loading progress changes
Parameters
-
value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null
Returns any
-
ready State
-
Returns client's state
Returns number
response
-
Returns client's response
Returns any
response Text
-
Returns client's response as text
Returns string
response Type
-
Gets or sets the expected response type
Returns XMLHttpRequestResponseType
-
Gets or sets the expected response type
Parameters
-
value: XMLHttpRequestResponseType
Returns any
-
responseURL
-
Returns client's response url
Returns string
status
-
Returns client's status
Returns number
status Text
-
Returns client's status as a text
Returns string
Methods
abortSearch playground for abort
-
Cancels any network activity
Returns void
get Response HeaderSearch playground for getResponseHeader
-
Get the string containing the text of a particular header's value.
Parameters
-
name: string
The name of the header
Returns Nullable<string>
The string containing the text of the given header name
-
openSearch playground for open
-
Sets the request method, request URL
Parameters
-
method: string
defines the method to use (GET, POST, etc..)
-
url: string
defines the url to connect with
Returns void
-
sendSearch playground for send
-
Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD
Parameters
-
Optional body: Document | BodyInit | null
defines an optional request body
Returns void
-
set Request HeaderSearch playground for setRequestHeader
-
Sets the value of a request header.
Parameters
-
name: string
The name of the header whose value is to be set
-
value: string
The value to set as the body of the header
Returns void
-
Extended version of XMLHttpRequest with support for customizations (headers, ...)