"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "helpers/codegen/generators/salesforce-apex.js" between
hoppscotch-2.0.0.tar.gz and hoppscotch-2.1.0.tar.gz

About: Hoppscotch is a light-weight, web based API development suite.

salesforce-apex.js  (hoppscotch-2.0.0):salesforce-apex.js  (hoppscotch-2.1.0)
skipping to change at line 33 skipping to change at line 33
let requestBody = rawInput ? rawParams : rawRequestBody let requestBody = rawInput ? rawParams : rawRequestBody
requestBody = JSON.stringify(requestBody) requestBody = JSON.stringify(requestBody)
.replace(/^"|"$/g, "") .replace(/^"|"$/g, "")
.replace(/\\"/g, '"') .replace(/\\"/g, '"')
.replace(/'/g, "\\'") // Apex uses single quotes for strings .replace(/'/g, "\\'") // Apex uses single quotes for strings
// create request // create request
requestString.push(`HttpRequest request = new HttpRequest();\n`) requestString.push(`HttpRequest request = new HttpRequest();\n`)
requestString.push(`request.setMethod('${method}');\n`) requestString.push(`request.setMethod('${method}');\n`)
requestString.push( requestString.push(
`request.setEndpoint('${url}${pathName}${queryString}');\n\n` `request.setEndpoint('${url}${pathName}?${queryString}');\n\n`
) )
// authentification // authentification
if (auth === "Basic Auth") { if (auth === "Basic Auth") {
const basic = `${httpUser}:${httpPassword}` const basic = `${httpUser}:${httpPassword}`
requestString.push( requestString.push(
`request.setHeader('Authorization', 'Basic ${window.btoa( `request.setHeader('Authorization', 'Basic ${window.btoa(
unescape(encodeURIComponent(basic)) unescape(encodeURIComponent(basic))
)}');\n` )}');\n`
) )
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)