"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "helpers/codegen/generators/ruby-net-http.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.

ruby-net-http.js  (hoppscotch-2.0.0):ruby-net-http.js  (hoppscotch-2.1.0)
skipping to change at line 38 skipping to change at line 38
const verbs = [ const verbs = [
{ verb: "GET", rbMethod: "Get" }, { verb: "GET", rbMethod: "Get" },
{ verb: "POST", rbMethod: "Post" }, { verb: "POST", rbMethod: "Post" },
{ verb: "PUT", rbMethod: "Put" }, { verb: "PUT", rbMethod: "Put" },
{ verb: "PATCH", rbMethod: "Patch" }, { verb: "PATCH", rbMethod: "Patch" },
{ verb: "DELETE", rbMethod: "Delete" }, { verb: "DELETE", rbMethod: "Delete" },
] ]
// create URI and request // create URI and request
const verb = verbs.find((v) => v.verb === method) const verb = verbs.find((v) => v.verb === method)
requestString.push(`uri = URI.parse('${url}${pathName}${queryString}')\n`) requestString.push(`uri = URI.parse('${url}${pathName}?${queryString}')\n`)
requestString.push(`request = Net::HTTP::${verb.rbMethod}.new(uri)`) requestString.push(`request = Net::HTTP::${verb.rbMethod}.new(uri)`)
// content type // content type
if (contentType) { if (contentType) {
requestString.push(`request['Content-Type'] = '${contentType}'`) requestString.push(`request['Content-Type'] = '${contentType}'`)
} }
// custom headers // custom headers
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

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