Skip to content

Commit

Permalink
include http method in fetch request (#4593)
Browse files Browse the repository at this point in the history
  • Loading branch information
JhontSouth authored Dec 22, 2023
1 parent 6efb46d commit 709a823
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import { ServiceClientCredentialsFactory } from './serviceClientCredentialsFacto
import { USER_AGENT } from './connectorFactoryImpl';
import { WebResource } from '@azure/core-http';
import { ok } from 'assert';
import fetch from 'cross-fetch';

const botFrameworkClientFetchImpl: typeof fetch = async (input, init) => {
const url = z.string().parse(input);
const { body, headers } = z.object({ body: z.string(), headers: z.record(z.string()).optional() }).parse(init);

const response = await fetch(url, {
body: JSON.parse(body),
method: 'POST',
body,
headers,
});

Expand Down

0 comments on commit 709a823

Please sign in to comment.