Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 2.53 KB

API.md

File metadata and controls

64 lines (49 loc) · 2.53 KB

Modules

Cowl

Typedefs

Response : Object
RequestOptions : Object

Cowl

Cowl.request(optionsOrURL) ⇒ Promise.<Response>

Make a request

Kind: static method of Cowl

Param Type Description
optionsOrURL RequestOptions | String An object containing request options or a string containing the URL to GET

Response : Object

Kind: global typedef
Properties

Name Type Description
url String The response URL
method String The method used for the request
headers Object Response headers
data String | Object | ArrayBuffer | Buffer Response data
status Number The status code of the response
statusText String The status text

RequestOptions : Object

Kind: global typedef
Properties

Name Type Description
url String The URL to request
[method] String The HTTP method to use for the request
body Object | Buffer | ArrayBuffer | String The request body to send
[headers] Object The request headers
[query] Object Query string parameters
[withCredentials] Boolean Set the XMLHttpRequest 'withCredentials' property
[responseType] String Set the response type. This defaults to 'auto' with which the responseType is not set on the request and is auto-detected when the response arrives (ideal only for JSON/text). Set it to a valid value as mentioned in the spec.
[factory] function Function that returns a new XMLHttpRequest instance
[validateStatus] function Function to validate a status value (return true for OK)
[nodeJsOptions] Object Optional NodeJS options to pass to XHR2 (not applied in the browser)