@hubspot/api-client
Version:
NodeJS v3 [HubSpot API](https://developers.hubspot.com/docs/api/overview) SDK(Client) files
25 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IsomorphicFetchHttpLibrary = void 0;
const http_1 = require("./http");
const rxjsStub_1 = require("../rxjsStub");
const Transport_1 = require("../../../src/services/http/Transport");
class IsomorphicFetchHttpLibrary {
send(request) {
const resultPromise = (0, Transport_1.sendBufferedRequest)(request.getUrl(), {
method: request.getHttpMethod().toString(),
body: request.getBody(),
headers: request.getHeaders(),
agent: request.getAgent(),
}).then((response) => {
const body = {
text: () => response.text(),
binary: () => response.binary()
};
return new http_1.ResponseContext(response.status, response.headers, body);
});
return (0, rxjsStub_1.from)(resultPromise);
}
}
exports.IsomorphicFetchHttpLibrary = IsomorphicFetchHttpLibrary;
//# sourceMappingURL=isomorphic-fetch.js.map