Add quotation marks for generated code (#187)
Add quotation marks for generated code
This commit is contained in:
@@ -593,7 +593,7 @@
|
||||
requestString.push('const xhr = new XMLHttpRequest()');
|
||||
const user = this.auth === 'Basic' ? this.httpUser : null
|
||||
const pswd = this.auth === 'Basic' ? this.httpPassword : null
|
||||
requestString.push('xhr.open(' + this.method + ', ' + this.url + this.path + this.queryString + ', true, ' +
|
||||
requestString.push('xhr.open("' + this.method + '", "' + this.url + this.path + this.queryString + '", true, ' +
|
||||
user + ', ' + pswd + ')');
|
||||
if (this.auth === 'Bearer Token') {
|
||||
requestString.push("xhr.setRequestHeader('Authorization', 'Bearer ' + " + this.bearerToken + ")");
|
||||
@@ -615,7 +615,7 @@
|
||||
} else if (this.requestType == 'Fetch') {
|
||||
var requestString = [];
|
||||
var headers = [];
|
||||
requestString.push('fetch(' + this.url + this.path + this.queryString + ', {\n')
|
||||
requestString.push('fetch("' + this.url + this.path + this.queryString + '", {\n')
|
||||
requestString.push(' method: "' + this.method + '",\n')
|
||||
if (this.auth === 'Basic') {
|
||||
var basic = this.httpUser + ':' + this.httpPassword;
|
||||
|
||||
Reference in New Issue
Block a user