Optional
XHRClassYou can optionally provide a XHRClass, which can be useful when using node.js
XMLHttpRequest
Optional
authIf you want to use http authentification, provide your details here
Optional
password?: null | stringOptional
username?: null | stringOptional
dataGives knorry a hint on which type of data you want to send. Not necessary but recommended. If data is a plain Object and no instance of FormData, URLSearchParams or Blob this will default to 'json'
'text'
Optional
easyIndicates wether the response should be an response object or an extended primitive type
true
Optional
headersProvide you headers here NOTE: Header don't use camelcase, you might have to use quotes like in this example:
{
* 'Content-Type': 'application/json'
* }
Optional
timeoutSpecifies the timeout for the request in ms When set to 0 or undefined no timeout will be used
Optional
uploadHere you can optionally provide event handlers fo file uploads
An event handler function which is called everytime upload progress was made
A number between 0 and 1 indicating how much progress was already made
Already uploaded bytes
Total file size in bytes
Optional
withStates wether credentials should bei included or not
true
Optional
beforeOptional
errorIf you want to, you can define an error handler here. If a error handler is defined in the options, your promise won't reject anymore
The error that occured
Gives you the option to resolve the promise with a specified value
Optional
onGenerated using TypeDoc
Here you can provide request options including headers. If you want to set some options globally, use defineKnorryOptions({ ... })