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. 

icon

Best answer by larsbenedetto 28 July 2022, 03:02

View original

3 replies

Userlevel 6
Badge +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!

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.

Userlevel 6
Badge +9

Amazing, thanks for the update @larsbenedetto

Reply