-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
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
Add support for GET parameters #10
Conversation
twitter.js
Outdated
@@ -52,9 +53,11 @@ class Twitter { | |||
|
|||
async get(resource) { | |||
const requestData = { | |||
url: `${this.url}/${resource}.json`, | |||
url: `${this.url}/${resource}.json?${querystring.stringify(parameters)}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not passing in parameters
anywhere
twitter.js
Outdated
method: "GET" | ||
}; | ||
if (parameters) | ||
requestData.url += "?" + querystring.stringify(parameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this duplicate what you've done above under requestData.url
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, wrong copy/paste from local files. Should be OK now.
Looks great! I made you a collaborator so you can feel free to merge when you're ready! Thanks!!! |
From what I've seen so far, no Twitter APIs take nested objects as parameters, so querystring should suffice. Otherwise, we can use the qs module.