We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Your code generator for Node and JQuery is very good at the top, then tails away, for example at the start, this is good:
var https = require('https'); var options = { 'method': 'POST', 'hostname': .... }; var req = https.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); ...
However, this code is not so good:
var postData = "{\n\tFieldName: 'data'\n}"; req.write(postData); req.end();
May I suggest that this last bit uses proper JSON objects rather than strings which are simply yuk!
Even this JQuery code:
var settings = { "url": "https://postman.com/security/authenticate", "method": "POST", ... "data": "{\r\n\tFullName: '{{FullName}}',\r\n\tPassword: '{{Password}}'\r\n}" };
Should be re-written as:
var credentials = { FullName: '{{FullName}}', Password: '{{Password}}' }; var sJSON = JSON.stringify(credentials); var settings = { "url": "https://postman.com/security/authenticate", "method": "POST", ... "data": sJSON };
Much easier to read, agree?
Everything else is coming along nicely ;-)
The text was updated successfully, but these errors were encountered:
JSON.stringify
Successfully merging a pull request may close this issue.
Your code generator for Node and JQuery is very good at the top, then tails away, for example at the start, this is good:
However, this code is not so good:
May I suggest that this last bit uses proper JSON objects rather than strings which are simply yuk!
Even this JQuery code:
Should be re-written as:
Much easier to read, agree?
Everything else is coming along nicely ;-)
The text was updated successfully, but these errors were encountered: