question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[notification hubs] SDK cannot parse valid JSON response

See original GitHub issue

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:

  1. Create an installation
  2. 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: CleanShot 2022-11-04 at 23 54 09@2x

Response: CleanShot 2022-11-04 at 23 55 38@2x

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mpodwysockicommented, Nov 7, 2022

@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

0reactions
mpodwysockicommented, Dec 14, 2022

Closing as fixed by service team

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found