Skip to content

Commit d4fddfd

Browse files
committed
fix: allow delete to have body
1 parent 8520585 commit d4fddfd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: packages/elements-core/src/components/TryIt/build-request.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export async function buildFetchRequest({
147147
const serverUrl = getServerUrl({ httpOperation, mockData, chosenServer, corsProxy, serverVariableValues });
148148

149149
const shouldIncludeBody =
150-
['PUT', 'POST', 'PATCH'].includes(httpOperation.method.toUpperCase()) && bodyInput !== undefined;
150+
['PUT', 'POST', 'PATCH', 'DELETE'].includes(httpOperation.method.toUpperCase()) && bodyInput !== undefined;
151151

152152
const queryParams = getQueryParams({ httpOperation, parameterValues });
153153

@@ -264,7 +264,7 @@ export async function buildHarRequest({
264264

265265
const mimeType = mediaTypeContent?.mediaType ?? 'application/json';
266266
const shouldIncludeBody =
267-
['PUT', 'POST', 'PATCH'].includes(httpOperation.method.toUpperCase()) && bodyInput !== undefined;
267+
['PUT', 'POST', 'PATCH', 'DELETE'].includes(httpOperation.method.toUpperCase()) && bodyInput !== undefined;
268268

269269
const queryParams = getQueryParams({ httpOperation, parameterValues });
270270

0 commit comments

Comments
 (0)