Merge pull request #131 from yubathom/master
Bind raw body input to url of requests
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user