smartrequest/dist/index.js

33 lines
2.9 KiB
JavaScript
Raw Normal View History

2017-01-28 23:51:47 +00:00
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const smartrequest_request_1 = require("./smartrequest.request");
2017-01-29 00:12:42 +00:00
var smartrequest_request_2 = require("./smartrequest.request");
exports.request = smartrequest_request_2.request;
2017-01-28 23:51:47 +00:00
exports.get = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () {
optionsArg.method = 'GET';
let response = yield smartrequest_request_1.request(domainArg, optionsArg);
return response;
});
exports.post = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () {
optionsArg.method = 'POST';
let response = yield smartrequest_request_1.request(domainArg, optionsArg);
return response;
});
exports.put = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () {
optionsArg.method = 'PUT';
let response = yield smartrequest_request_1.request(domainArg, optionsArg);
return response;
});
exports.del = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () {
optionsArg.method = 'DELETE';
let response = yield smartrequest_request_1.request(domainArg, optionsArg);
return response;
});
2017-01-29 00:12:42 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFLQSxpRUFBZ0Q7QUFHaEQsK0RBQWdEO0FBQXZDLHlDQUFBLE9BQU8sQ0FBQTtBQUdMLFFBQUEsR0FBRyxHQUFHLENBQ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