From 28e396cb1b238b9bc63b41496caefbc9ba004d2c Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 3 Jun 2024 07:26:40 -0700 Subject: [PATCH] Don't always change request method. Closes #29 --- src-web/components/RequestPane.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src-web/components/RequestPane.tsx b/src-web/components/RequestPane.tsx index b35b6a68..ea57214d 100644 --- a/src-web/components/RequestPane.tsx +++ b/src-web/components/RequestPane.tsx @@ -109,11 +109,14 @@ export const RequestPane = memo(function RequestPane({ if (bodyType === BODY_TYPE_NONE) { newContentType = null; } else if ( - bodyType === BODY_TYPE_FORM_URLENCODED || - bodyType === BODY_TYPE_FORM_MULTIPART || - bodyType === BODY_TYPE_JSON || - bodyType === BODY_TYPE_OTHER || - bodyType === BODY_TYPE_XML + activeRequest.method.toLowerCase() !== 'put' && + activeRequest.method.toLowerCase() !== 'patch' && + activeRequest.method.toLowerCase() !== 'post' && + (bodyType === BODY_TYPE_FORM_URLENCODED || + bodyType === BODY_TYPE_FORM_MULTIPART || + bodyType === BODY_TYPE_JSON || + bodyType === BODY_TYPE_OTHER || + bodyType === BODY_TYPE_XML) ) { patch.method = 'POST'; newContentType = bodyType === BODY_TYPE_OTHER ? 'text/plain' : bodyType; @@ -181,6 +184,7 @@ export const RequestPane = memo(function RequestPane({ activeRequest.authenticationType, activeRequest.bodyType, activeRequest.headers, + activeRequest.method, activeRequest.urlParameters, handleContentTypeChange, updateRequest,