WILCO.api
root of the APIV3 end-point
Last updated
Was this helpful?
root of the APIV3 end-point
Last updated
Was this helpful?
WILCO.api allows you to get, post, put, delete... on the server using the APIV3 endpoint. It always return promises and are async.
The credentials are injected according to the person that is logged in
params – {Object.<string|Object>}
– Map of strings or objects which will be serialized with the paramSerializer
and appended as GET parameters.
headers – {Object}
– Map of strings or functions which return strings representing HTTP headers to send to the server. If the return value of a function is null, the header will not be sent. Functions accept a config object as an argument.
eventHandlers - {Object}
- Event listeners to be bound to the XMLHttpRequest object. To bind events to the XMLHttpRequest upload object, use uploadEventHandlers
. The handler will be called in the context of a $apply
block.
uploadEventHandlers - {Object}
- Event listeners to be bound to the XMLHttpRequest upload object. To bind events to the XMLHttpRequest object, use eventHandlers
. The handler will be called in the context of a $apply
block.
xsrfHeaderName – {string}
– Name of HTTP header to populate with the XSRF token.
xsrfCookieName – {string}
– Name of cookie containing the XSRF token.
transformRequest – {function(data, headersGetter)|Array.<function(data, headersGetter)>}
– transform function or an array of such functions. The transform function takes the http request body and headers and returns its transformed (typically serialized) version. See
transformResponse – {function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}
– transform function or an array of such functions. The transform function takes the http response body, headers and status and returns its transformed (typically deserialized) version. See
paramSerializer - {string|function(Object<string,string>):string}
- A function used to prepare the string representation of request parameters (specified as an object). If specified as string, it is interpreted as function registered with the , which means you can create your own serializer by registering it as a . The default serializer is the ; alternatively, you can use the
cache – {boolean|Object}
– A boolean value or object created with to enable or disable caching of the HTTP response. See for more information.
timeout – {number|Promise}
– timeout in milliseconds, or that should abort the request when resolved.
A numerical timeout or a promise returned from , will set the xhrStatus
in the to "timeout", and any other resolved promise will set it to "abort", following standard XMLHttpRequest behavior.
withCredentials - {boolean}
- whether to set the withCredentials
flag on the XHR object. See for more information.
responseType - {string}
- see .