Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

Updated POST request body to react to the Content Type

Andrew Bastinfa339a518372
diff --git a/pages/index.vue b/pages/index.vue
index 4b53a3057..5a1996734 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -375,7 +375,7 @@
<label for="rawBody">{{ $t("raw_request_body") }}</label>
<Editor
v-model="rawParams"
- :lang="'json'"
+ :lang="rawInputEditorLang"
:options="{
maxLines: '16',
minLines: '8',
@@ -1385,6 +1385,7 @@ import AceEditor from "../components/ace-editor";
import { tokenRequest, oauthRedirect } from "../assets/js/oauth";
import { sendNetworkRequest } from "../functions/network";
import { fb } from "../functions/fb";
+import { getEditorLangForMimeType } from "~/functions/editorutils";
const statusCategories = [
{
@@ -1808,6 +1809,9 @@ export default {
this.$store.commit("setState", { value, attribute: "rawInput" });
}
},
+ rawInputEditorLang() {
+ return getEditorLangForMimeType(this.contentType);
+ },
requestType: {
get() {
return this.$store.state.request.requestType;