shell-httpie.js (hoppscotch-2.0.0) | : | shell-httpie.js (hoppscotch-2.1.0) | ||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
// Executable itself | // Executable itself | |||
requestString.push(`http`) | requestString.push(`http`) | |||
// basic authentication | // basic authentication | |||
if (auth === "Basic Auth") { | if (auth === "Basic Auth") { | |||
requestString.push(` -a ${httpUser}:${httpPassword}`) | requestString.push(` -a ${httpUser}:${httpPassword}`) | |||
} | } | |||
// URL | // URL | |||
let escapedUrl = `${url}${pathName}${queryString}` | let escapedUrl = `${url}${pathName}?${queryString}` | |||
escapedUrl = escapedUrl.replace(/'/g, "\\'") | escapedUrl = escapedUrl.replace(/'/g, "\\'") | |||
requestString.push(` ${method} $'${escapedUrl}'`) | requestString.push(` ${method} $'${escapedUrl}'`) | |||
// All headers | // All headers | |||
if (contentType) { | if (contentType) { | |||
requestString.push(` 'Content-Type:${contentType}; charset=utf-8'`) | requestString.push(` 'Content-Type:${contentType}; charset=utf-8'`) | |||
} | } | |||
if (headers) { | if (headers) { | |||
headers.forEach(({ key, value }) => { | headers.forEach(({ key, value }) => { | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |