-
Notifications
You must be signed in to change notification settings - Fork 235
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
request('get'...) can't pass json data #115
Comments
Looks like you're just passing "true" as the options. Try with:
|
In your example, where is my json data? |
Oh, now I see. When passing data to a GET request, Needle builds a query string and appends it to the URL, given that those requests should not contain a body. |
Yea. Whatever you are doing isn't working for me. I am trying to pass json data through a get. Just FYI, CURL works, and the 'request' npm package works too. |
Why would you want to send a body as part of a GET request anyway? You might want to suggest the developer of that endpoint to stick to the spec. Needle doesn't send bodies on GET requests because there's a very high chance that the server on the other side won't even mind to read it. |
Tell that to elasticsearch |
Ensures that tomas/needle#115 will work
+1, It will be very useful for many API and more elegant than:
|
Ensures that tomas/needle#115 will work
Network traffic see with curl:
With needle:
JS Code:
Resulting network traffic:
Thanks.
Blake
The text was updated successfully, but these errors were encountered: