Scandit.DeferredHttp.Response

new Response()

Creates a new HTTP Response instance

Properties:
Name Type Description
id string

Request identifier

request Scandit.Http.Request

HTTP Request instance

response Scandit.Http.Response

HTTP Response instance

state string

Status of the request. Can be one of PENDING, COMPLETED, FAILED, CANCELED.

createdAt Date

Creation date

startAt Date

Request execution start date

lastStateChangedAt Date

Last state change date

retries integer

Number of tries

lastFailAt Date

Last failure date

lastFailReason string

Last failure reason

lastFailResponse Scandit.Http.Response

Last failure HTTP Response

Methods

cancel(): Promise

Cancels a request

Returns:
Promise

Can return an error with code:

Examples
  • JavaScript
  • ES6
var query = {
  createdAt: {$gt: (new Date('01-01-2016'))}
};
Scandit.DeferredHttp.findRequests(query).then(function(requests) {
  requests.forEach(function(request) {
    request.cancel();
  });
});
const query = {
  createdAt: {$gt: (new Date('01-01-2016'))}
};
Scandit.DeferredHttp.findRequests(query).then(requests => {
  requests.forEach(request => {
    request.cancel();
  });
});

forget(): Promise

Forgets a request

Returns:
Promise

Can return an error with code:

Examples
  • JavaScript
  • ES6
var query = {
  createdAt: {$gt: (new Date('01-01-2016'))}
};
Scandit.DeferredHttp.findRequests(query).then(function(requests) {
  requests.forEach(function(request) {
    request.forget();
  });
});
const query = {
  createdAt: {$gt: (new Date('01-01-2016'))}
};
Scandit.DeferredHttp.findRequests(query).then(requests => {
  requests.forEach(request => {
    request.forget();
  });
});

retry(): Promise

Retries a failed request

Returns:
Promise

Can return an error with code:

Examples
  • JavaScript
  • ES6
var query = {
  createdAt: {$gt: (new Date('01-01-2016'))}
};
Scandit.DeferredHttp.findRequests(query).then(function(requests) {
  requests.forEach(function(request) {
    request.retry();
  });
});
const query = {
  createdAt: {$gt: (new Date('01-01-2016'))}
};
Scandit.DeferredHttp.findRequests(query).then(requests => {
  requests.forEach(request => {
    request.retry();
  });
});