forked from microsoftgraph/msgraph-sdk-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HTTPMessageHandler.ts
31 lines (28 loc) · 916 Bytes
/
HTTPMessageHandler.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/
/**
* @module HTTPMessageHandler
*/
import { Context } from "../IContext";
import { Middleware } from "./IMiddleware";
/**
* @class
* @implements Middleware
* Class for HTTPMessageHandler
*/
export class HTTPMessageHandler implements Middleware {
/**
* @public
* @async
* To execute the current middleware
* @param {Context} context - The request context object
* @returns A promise that resolves to nothing
*/
public async execute(context: Context): Promise<void> {
context.response = await fetch(context.request, context.options);
}
}