Skip to content
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

Merged
merged 2 commits into from
Feb 20, 2018
Merged

Add support for GET parameters #10

merged 2 commits into from
Feb 20, 2018

Conversation

dandv
Copy link
Collaborator

@dandv dandv commented Feb 20, 2018

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.

This was referenced Feb 20, 2018
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)}`,
Copy link
Contributor

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);
Copy link
Contributor

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?

Copy link
Collaborator Author

@dandv dandv left a 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.

@peterpme
Copy link
Contributor

Looks great! I made you a collaborator so you can feel free to merge when you're ready! Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants