Module: whatwg-xhr

Main module - A Node.js implementation of the WHATWG XMLHttpRequest Living Standard for non-browser environments.
Version:
  • 1.0.0
Author:
  • Essam A. El-Sherif
Source:

Classes

FormData
ProgressEvent
XMLHttpRequest
ClientRequestData
XMLHttpRequestEventTarget
XMLHttpRequestUpload

Interfaces

Event
EventTarget

Members

(static, constant) disableHeaderCheck :boolean

Allow request-headers forbidden by XHR Specs.
Type:
  • boolean
Source:

(inner, constant) XMLHttpRequestResponseType :object

Enumerated set of response types.
Type:
  • object
Source:

(inner, constant) formData :WeakMap

Map any FormData object created to an associated data object.
Type:
  • WeakMap
Source:

(inner, constant) progressEvent :WeakMap

Map any ProgressEvent object created to an associated data object.
Type:
  • WeakMap
Source:

(inner, constant) xmlHttpRequest :WeakMap

Map any XMLHttpRequest object created to an associated data object.
Type:
  • WeakMap
Source:

(inner, constant) xmlHttpRequestEventTarget :WeakMap

Map any XMLHttpRequestEventTarget object created to an associated data object.
Type:
  • WeakMap
Source:

Methods

(inner) defaultHeaders() → {object}

Source:
Returns:
Default headers to include in each XMLHttpRequest.
Type
object

(inner) defaultHeadersCase() → {object}

Source:
Returns:
Lower case default headers.
Type
object

(inner) getFinalEncoding() → {string|null}

Get a final encoding for an XMLHttpRequest object xhr, as given by XHR specs.
This:
Source:
Requires:
Returns:
Final encoding.
Type
string | null

(inner) getFinalMimeType() → {string}

Get a final MIME type for an XMLHttpRequest object xhr, as given by XHR specs.
This:
Source:
Returns:
MIME type.
Type
string

(inner) getResponseMimeType() → {string}

Get a response MIME type for an XMLHttpRequest object xhr, as given by XHR specs.
This:
Source:
Requires:
Returns:
MIME type.
Type
string

(inner) getTextResponse() → {string}

Get a text for an XMLHttpRequest object xhr, as given by XHR specs.
This:
Source:
Requires:
Returns:
Text response.
Type
string

(inner) handleError(Error)

Handle errors for an XMLHttpRequest object, as given by XHR specs.
This:
Parameters:
Name Type Description
Error object object.
Source:

(inner) requestDataURL(options) → {object}

Emulates the node http.request function for processing data url's.
Parameters:
Name Type Description
options object Options passed to the node http.request function.
Source:
Requires:
Returns:
ClientRequestData object.
Type
object

(inner) requestErrorSteps(Event, Exception)

Request error steps for an XMLHttpRequest object , , and optionally , as given by XHR specs.
This:
Parameters:
Name Type Description
Event string type
Exception object | string
Source:

(inner) setDocumentResponse()

Set a document response for an XMLHttpRequest object xhr, as given by XHR specs.
This:
Source:
Requires:

(inner) setResponseToNetworkError()

Network error is a response whose type is "error", as defined by Fetch specs.
This:
Source:

A Node.js implementation of the WHATWG XMLHttpRequest Living Standard for non-browser environments.