diff --git a/assets/css/styles.scss b/assets/css/styles.scss
index 4774b393e..c790d9fd2 100644
--- a/assets/css/styles.scss
+++ b/assets/css/styles.scss
@@ -172,6 +172,14 @@ fieldset.purple legend {
color: #C198FB;
}
+fieldset.orange {
+ border-color: #FF9800;
+}
+
+fieldset.orange legend {
+ color: #FF9800;
+}
+
.collapsible.hidden {
display: none;
}
diff --git a/pages/index.vue b/pages/index.vue
index 135aa4832..4e437b1f5 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -34,6 +34,7 @@
@@ -103,7 +104,36 @@
-
+
+
+ -
+
+
+
+ -
+
+
+
+ -
+
+
+
+
+
+
+
+
+
-
@@ -132,7 +162,7 @@
-
+
-
@@ -235,6 +265,7 @@
httpUser: '',
httpPassword: '',
bearerToken: '',
+ headers: [],
params: [],
bodyParams: [],
rawParams: '',
@@ -287,6 +318,17 @@
}) => `${key}=${encodeURIComponent(value)}`).join('&')
}
},
+ headerString() {
+ const result = this.headers
+ .filter(({
+ key
+ }) => !!key)
+ .map(({
+ key,
+ value
+ }) => `${key}: ${value}`).join(',\n')
+ return result == '' ? '' : `${result}`
+ },
queryString() {
const result = this.params
.filter(({
@@ -339,6 +381,11 @@
if (this.auth === 'Bearer Token') {
xhr.setRequestHeader('Authorization', 'Bearer ' + this.bearerToken);
}
+ if (this.headers) {
+ this.headers.forEach(function (element) {
+ xhr.setRequestHeader(element.key, element.value)
+ })
+ }
if (this.method === 'POST' || this.method === 'PUT') {
const requestBody = this.rawInput ? this.rawParams : this.rawRequestBody;
xhr.setRequestHeader('Content-Length', requestBody.length)
@@ -375,6 +422,16 @@
this.response.body = xhr.statusText
}
},
+ addRequestHeader() {
+ this.headers.push({
+ key: '',
+ value: ''
+ })
+ return false
+ },
+ removeRequestHeader(index) {
+ this.headers.splice(index, 1)
+ },
addRequestParam() {
this.params.push({
key: '',