/**
* Copyright© 2016, Oracle and/or its affiliates. All rights reserved.
*/
function GetProcessor(backend, apiName, endpointPath, platform, utils, persistence) {
SyncProcessor.call(this, backend, apiName, endpointPath, false, utils, persistence);
this.performRequest = function (url, requestHeaders, fetchFromService) {
var processor = this;
var headers = processor.getHttpHeaders(requestHeaders);
// TODO: check how to call with fetchFromService parameter
return platform.invokeService({
method: utils.HTTP_METHODS.GET,
url: url,
headers: headers
}).then(success);
function success(response) {
return {
uri: processor.getUri(response, url),
data: response.data
};
}
}
}
GetProcessor.prototype = Object.create(SyncProcessor.prototype);
GetProcessor.prototype.constructor = GetProcessor;