HTTP(s) transport based on XMLHttpRequest To use in nodeJS XMLHttpRequest should be defined in global like

 global.XMLHttpRequest = require('xhr2')

Types

# XHRResponse inner

Result of xhr / get / post HTTP request

Properties

  • data string  | Object  | ArrayBuffer

    response body:

    • if Content-Type of the response is application/json - an Object contains response body parsed using JSON.parse
    • if request is called with {responseType: 'arraybuffer'} option - response body as ArrayBuffer
    • string in other case

  • status number

    response HTTP status code

  • headers function

    header getter function

  • config Object

    configuration object that was used for request