UNPKG

1.39 kBJavaScriptView Raw
1"use strict";
2var __assign = (this && this.__assign) || function () {
3 __assign = Object.assign || function(t) {
4 for (var s, i = 1, n = arguments.length; i < n; i++) {
5 s = arguments[i];
6 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7 t[p] = s[p];
8 }
9 return t;
10 };
11 return __assign.apply(this, arguments);
12};
13Object.defineProperty(exports, "__esModule", { value: true });
14exports.HttpClient = void 0;
15var HttpClient = /** @class */ (function () {
16 function HttpClient(configOptions) {
17 this.clientOptions = __assign(__assign({}, HttpClient.DefaultOptions), configOptions);
18 this.initHttpClient(this.clientOptions);
19 }
20 HttpClient.prototype.getBaseHttpRequestURL = function () {
21 var scheme = this.clientOptions.useHttps ? "https" : "http";
22 return "".concat(scheme, "://").concat(this.clientOptions.requestHost);
23 };
24 /**
25 * Http Client connection configuration options.
26 * You may modify these values and new clients will use them.
27 * Any values provided to a Client constructor will override default options.
28 */
29 HttpClient.DefaultOptions = {
30 useHttps: true,
31 requestHost: "api.postmarkapp.com",
32 timeout: 180,
33 };
34 return HttpClient;
35}());
36exports.HttpClient = HttpClient;
37//# sourceMappingURL=HttpClient.js.map
\No newline at end of file