Skip to content

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

Bind raw body input to url of requests

yubathom41e6f7d61e57
diff --git a/pages/index.vue b/pages/index.vue
index b43df6625..d914d3110 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -583,14 +583,20 @@
} else return ''
}
let flats = ['method', 'url', 'path', 'auth', 'httpUser', 'httpPassword', 'bearerToken', 'contentType'].map(item => flat(item))
- let deeps = ['headers', 'params', 'bodyParams'].map(item => deep(item))
- this.$router.replace('/?' + flats.concat(deeps).join('').slice(0, -1))
+ let deeps = ['headers', 'params'].map(item => deep(item))
+ let bodyParams = this.rawInput ? [flat('rawParams')] : [deep('bodyParams')];
+
+ this.$router.replace('/?' + flats.concat(deeps, bodyParams).join('').slice(0, -1))
},
setRouteQueries(queries) {
if (typeof(queries) !== 'object') throw new Error('Route query parameters must be a Object')
for (const key in queries) {
if (key === 'headers' || key === 'params' || key === 'bodyParams') this[key] = JSON.parse(queries[key])
- else if (typeof(this[key]) === 'string') this[key] = queries[key];
+ if (key === 'rawParams') {
+ this.rawInput = true
+ this.rawParams = queries['rawParams']
+ }
+ else if (typeof(this[key]) === 'string') this[key] = queries[key]
}
},
observeRequestButton() {
@@ -623,11 +629,11 @@
vm.headers,
vm.params,
vm.bodyParams,
- vm.contentType
+ vm.contentType,
+ vm.rawParams
], val => {
this.setRouteQueryState()
})
-
}
}