From 62a5beb52f1e9fd382bb17de8029988cf56ed6f2 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Mon, 18 Apr 2022 21:37:15 +0530 Subject: [PATCH] chore: update 'post' method usages to be uppercased as per HTTP spec --- packages/hoppscotch-app/helpers/GQLConnection.ts | 4 ++-- packages/hoppscotch-app/helpers/curl/sub_helpers/method.ts | 2 +- packages/hoppscotch-app/helpers/oauth.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hoppscotch-app/helpers/GQLConnection.ts b/packages/hoppscotch-app/helpers/GQLConnection.ts index 9c002a093..0f9bdf581 100644 --- a/packages/hoppscotch-app/helpers/GQLConnection.ts +++ b/packages/hoppscotch-app/helpers/GQLConnection.ts @@ -149,7 +149,7 @@ export class GQLConnection { .forEach((x) => (finalHeaders[x.key] = x.value)) const reqOptions = { - method: "post", + method: "POST", url, headers: { ...finalHeaders, @@ -213,7 +213,7 @@ export class GQLConnection { .forEach(({ key, value }) => (finalHeaders[key] = value)) const reqOptions = { - method: "post", + method: "POST", url, headers: { ...finalHeaders, diff --git a/packages/hoppscotch-app/helpers/curl/sub_helpers/method.ts b/packages/hoppscotch-app/helpers/curl/sub_helpers/method.ts index 5a2648e40..ba0e4f274 100644 --- a/packages/hoppscotch-app/helpers/curl/sub_helpers/method.ts +++ b/packages/hoppscotch-app/helpers/curl/sub_helpers/method.ts @@ -50,7 +50,7 @@ const getMethodByDeduction = (parsedArguments: parser.Arguments) => { R.or(objHasArrayProperty("F", "string")) )(parsedArguments) ) - return O.some("post") + return O.some("POST") else return O.none } diff --git a/packages/hoppscotch-app/helpers/oauth.js b/packages/hoppscotch-app/helpers/oauth.js index 66654156d..f686bd97e 100644 --- a/packages/hoppscotch-app/helpers/oauth.js +++ b/packages/hoppscotch-app/helpers/oauth.js @@ -21,7 +21,7 @@ const sendPostRequest = async (url, params) => { .map((key) => `${key}=${params[key]}`) .join("&") const options = { - method: "post", + method: "POST", headers: { "Content-type": "application/x-www-form-urlencoded; charset=UTF-8", },