npm install requestadapter
RequestAdapter exposes an interface for interacting with javascript request response objects on Node and in the browser in a simple, unified way. It is best used in combination with superagent.
Returns an ra instance.
Returns the status code of the object.
Returns the text of the response body.
Returns the body as parsed JSON.
Returns all the response headers.
Warning: This method only gives partial adapter support
- In a Node environment the headers will be an object
- In a browser environment the headers will be a concatenated string
Returns the specified response header.
Warning: This method only gives partial adapter support
Header values differ between the browser and Node.
Returns the raw request response object instance for direct use.
Returns the method, like GET
or PUT
Returns the method in lower case form, like get
or put
Returns the URL of the request