-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
result.body is empty in Node but result.text is present #1078
Comments
Please send the full HTTP request and response headers if you can. That will help us troubleshoot. Auto-parsing of response bodies is primarily based on the |
Node requests seems to set the wrong
I run both this on Node and browser (result is attached): request.get('https://graph.facebook.com/v2.7/335148063288907')
.buffer(true)
.query({ access_token : <token> })
.then((success, failure) => {
console.log(JSON.stringify(success, null, 2))
}) content-type is On an unrelated note, I can't use |
I've found this is because Facebook is sensitive to the Adding |
So given this, I wonder what should we do:
|
+1 on documentation. -1 on presumptive parsing |
I think adding docs should be enough. |
The docs mention using |
I am using superagent in https://github.com/tkesgar/miyako for both Node backend and frontend. However, I found a problem when running this part of server code:
In the promise handling,
result.body
is{}
, butresult.text
contains the full endpoint response (endpoint is Facebook Graph API)..buffer(true)
doesn't work (result.body
is still empty), and content-type is already JSON.I was able to get it working with
JSON.parse(result.text)
, though. Also, I can useresult.body
on client-side without problems.I'll try to reproduce the problem if I have some time.
Environment:
The text was updated successfully, but these errors were encountered: