Skip to main content
Solved

Why does the API response header say text/html even though its actually returning JSON?


I’m trying to delete a user, but when I call the endpoint, the response header `Content-Type` is set to `text/html; charset=UTF-8`

https://www.docs.developers.amplitude.com/analytics/apis/user-privacy-api/#delete-users

 

The HTTP library I’m using in Java cannot figure out how to parse the response because it thinks its html when its actually json. 

Best answer by larsbenedetto

I was able to work around the issue by forcing Jackson to try to parse html as Json.

 

My Java version and everything else about my code is irrelevant since I also receive text/html response with curl and with Postman.

View original
Did this topic help you find an answer to your question?

3 replies

Jeremie Gluckman
Team Member
Forum|alt.badge.img+9

Hi @larsbenedetto  😀 Thanks for posting here. Somehow we missed this. Were you able to make progress? I’m looping in @ning.chang from our support team, who can help out. Thank you!


  • Author
  • New Member
  • 1 reply
  • Answer
  • July 28, 2022

I was able to work around the issue by forcing Jackson to try to parse html as Json.

 

My Java version and everything else about my code is irrelevant since I also receive text/html response with curl and with Postman.


Jeremie Gluckman
Team Member
Forum|alt.badge.img+9

Amazing, thanks for the update @larsbenedetto


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings