HTTP Client modifies XML response body

Answered

Question

Is it correct that the HTTP Client does not show the exact contents of the response body of a request, if the type is XML?

Scenario

To reproduce, create this file:

$ cat testdata.xml 
<d>\u0002</d>

Start a webserver, for example with JDK 18:

$ jwebserver --port 8000

Execute this request with the HTTP Client:

GET http://localhost:8000/testdata.xml

The response is shown:

Instead of the string \u0002, a symbol is shown that probably represents a Unicode U+0002 character.

curl returns the contents of the XML file:

$ curl -X GET --location "http://localhost:8000/testdata.xml"
<d>\u0002</d>

Tested with IDEA 2023.3.6.

0
2 comments

Hi Maarten - thanks for taking the time to report this.

It appears to be a bug. I reproduced it and submitted a bug report about it to our tracker so that the dev team can check it: https://youtrack.jetbrains.com/issue/IDEA-350518

You are welcome to follow the progress there. I will monitor it too.

0

Please sign in to leave a comment.