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

HTTP calls incorrectly expected to return JSON #7

Open
walliski opened this issue Aug 23, 2016 · 0 comments
Open

HTTP calls incorrectly expected to return JSON #7

walliski opened this issue Aug 23, 2016 · 0 comments

Comments

@walliski
Copy link

https://github.com/djluck/azure-active-directory/blame/master/lib/serverHttp.js#L18

The response that you get from HTTP data contains the following attributes:

statusCode Number
    Numeric HTTP result status code, or null on error.
content String
    The body of the HTTP response as a string.
data Object or null
    If the response headers indicate JSON content, this contains the body of the document parsed as a
    JSON object.
headers Object
    A dictionary of HTTP headers from the response. 

When adding a resource for the Onenote API and try to get page content, the content is not returned as JSON, but as a string of HTML. This means that response.data is null and the request throws an exception. 🎉 TypeError: Cannot read property 'error' of null

https://docs.meteor.com/api/http.html

walliski pushed a commit to walliski/azure-active-directory that referenced this issue Aug 24, 2016
The Meteor HTTP.call returns the data in the content variable in
case the data is not valid JSON.

Issue: djluck#7
theosp pushed a commit to justdoinc/azure-active-directory that referenced this issue Nov 26, 2019
The Meteor HTTP.call returns the data in the content variable in
case the data is not valid JSON.

Issue: djluck#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant