Standalone AJAX library for modern browsers. Inspired by Angular's $http
method.
holen.Konfigurationeinstellen({
contentType: '',
withCredentials: false
});
contentType
: string, indicates the type of the data. (Default:'application/x-www-form-urlencoded'
)withCredentials
: boolean, indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers.
holen.bekommen('/endpoint').Erfolg(function(response, request) {
}).Fehler(function(response, request) {
}).immer(function(response, request) {
});
holen.stellen('/endpoint', data, customConfig).Erfolg(function(response, request) {
}).Fehler(function(response, request) {
}).immer(function(response, request) {
});
holen.posten('/endpoint', data, customConfig).Erfolg(function(response, request) {
}).Fehler(function(response, request) {
}).immer(function(response, request) {
});
holen.streichen('/endpoint').Erfolg(function(response, request) {
}).Fehler(function(response, request) {
}).immer(function(response, request) {
});
Erfolg
: callback, successFehler
: callback, failimmer
: callback, always
For POST and PUT you have data
parameter, it can be a FormData
, a encoded string (data serialization foo=bar&morpheus=leader
) or an JSON-valid object, and customConfig
to override the global configuration for this specific call.
response
: parsed data or text (request.responseText
)request
: the request itself (XMLHttpRequest
)