UNPKG

1.58 kBJavaScriptView Raw
1"use strict";
2/**
3 * -------------------------------------------------------------------------------------------
4 * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
5 * See License in the project root for license information.
6 * -------------------------------------------------------------------------------------------
7 */
8Object.defineProperty(exports, "__esModule", { value: true });
9exports.HTTPMessageHandler = void 0;
10var tslib_1 = require("tslib");
11/**
12 * @class
13 * @implements Middleware
14 * Class for HTTPMessageHandler
15 */
16var HTTPMessageHandler = /** @class */ (function () {
17 function HTTPMessageHandler() {
18 }
19 /**
20 * @public
21 * @async
22 * To execute the current middleware
23 * @param {Context} context - The request context object
24 * @returns A promise that resolves to nothing
25 */
26 HTTPMessageHandler.prototype.execute = function (context) {
27 return tslib_1.__awaiter(this, void 0, void 0, function () {
28 var _a;
29 return tslib_1.__generator(this, function (_b) {
30 switch (_b.label) {
31 case 0:
32 _a = context;
33 return [4 /*yield*/, fetch(context.request, context.options)];
34 case 1:
35 _a.response = _b.sent();
36 return [2 /*return*/];
37 }
38 });
39 });
40 };
41 return HTTPMessageHandler;
42}());
43exports.HTTPMessageHandler = HTTPMessageHandler;
44//# sourceMappingURL=HTTPMessageHandler.js.map
\No newline at end of file