[notification hubs] SDK cannot parse valid JSON response
See original GitHub issue- Package Name: @azure/notification-hubs
- Package Version: 1.0.0-beta.7
Describe the bug
When retrieving an installation via getInstallation
, a RestError
is thrown stating the response body could not be parsed. The response body is valid JSON format. After debugging, I found the response headers contain a Content-Type
of application/xml
even though the response itself is JSON. I confirmed the outgoing request headers also contain the Content-Type
of application/json
.
To Reproduce Steps to reproduce the behavior:
- Create an installation
- Use the
getInstallation
method to get the installation.
Expected behavior
The SDK is able to parse a JSON reponse and not throw a RestError
Screenshots
Request:
Response:
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
`az rest` cannot parse json body · Issue #9742 · Azure/azure-cli
Describe the bug. The az rest fails to parse json body, as seen here: ; To Reproduce Run the scripts pasted above, but...
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >How to Fix the Invalid JSON Response Error in WordPress
The response is not a valid JSON response," it will typically appear when you're working on content in the WordPress Block Editor. In...
Read more >Registration Management - Notification Hubs - Microsoft Learn
This topic explains how to register devices with notification hubs in order to receive push notifications.
Read more >Valid JSON But can't parse it in my javascript - Stack Overflow
Probably the first var json = $.parseJSON(response.responseText) will give the json object. Try to console.log(json) that. Don't need to parse ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@bm77525-kr The Azure Notification Hubs service team is aware of the issue and will sync back here once we have an answer. cc @marstr
Closing as fixed by service team