Answered question

REST Request Response is coming other than json format

When I run below request using postman or other rest tools I get response in json format, but using neoload the response comes in below format not sure what is the format.

Sample Request:

Request:
GET https://<IP>/api/v2/private/security/clusters/fe866... HTTP/1.1
Connection: keep-alive
Accept: application/json, text/plain, */*
Content-Type: application/json
User-Agent: neoload
UM-CSRF-Token: 30087dbd-5153-4b2c-8323-e4a8ce506122
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Referer: https://<IP>; /api/management-server/admin/users/current
Cookie: JSESSIONID=LoEHmRamRGtzDMN4mTNw9WJq1mIrQ9FPINJZjINO.scspr1758580001; UM-CSRF=30087dbd-5153-4b2c-8323-e4a8ce506122

Response:

HTTP/1.1 200 OK
Expires: 0
Cache-Control: no-cache, no-store, must-revalidate
X-XSS-Protection: 1; mode=block
Pragma: no-cache
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:;
Date: Fri, 25 Oct 2019 22:02:22 GMT
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubDomains;
X-Content-Type-Options: nosniff
Content-Type: application/json;charset=UTF-8

<ObjectNode>
<__nodeFactory/>
<__children>
<entry>
<string>name</string>
<TextNode>
<__value>mobility-01-02</__value>
</TextNode>
</entry>
<entry>
<string>uuid</string>
<TextNode>
<__value>fe866c40-cab7-11e7-bcd5-00a09865cd13</__value>
</TextNode>
</entry>
<entry>
<string>security_compliant</string>
<BooleanNode/>
</entry>
<entry>
<string>volume_encryption</string>
<ObjectNode>
<__nodeFactory reference="../../../../__nodeFactory"/>
<__children>
<entry>
<string>software_encrypted_volume_count</string>
<IntNode>
<__value>0</__value>
</IntNode>
</entry>
<entry>
<string>hardware_encrypted_volume_count</string>
<IntNode reference="../../entry/IntNode"/>
</entry>
<entry>
<string>sw_hw_encrypted_volume_count</string>
<IntNode reference="../../entry/IntNode"/>
</entry>
<entry>
<string>unencrypted_volume_count</string>
<IntNode>
<__value>735</__value>
</IntNode>
</entry>
</__children>
</ObjectNode>
</entry>
<entry>

<entry>
<string>_links</string>
<ObjectNode>
<__nodeFactory reference="../../../../__nodeFactory"/>
<__children>
<entry>
<string>self</string>
<ObjectNode>
<__nodeFactory reference="../../../../../../../__nodeFactory"/>
<__children>
<entry>
<string>href</string>
<TextNode>
<__value>/api/v2/private/security/clusters/fe866c40-cab7-11e7-bcd5-00a09865cd13</__value>
</TextNode>
</entry>
</__children>
</ObjectNode>
</entry>
</__children>
</ObjectNode>
</entry>
</__children>
</ObjectNode>

RAJESH L.
RAJESH L.

RAJESH L.

Level
0
12 / 100
points
Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

Please go to the menu "Edit-->Preferences-->Projects settings tab--> Module manager-->JSON tab and  make sure that the option to convert the JSON response to XML is disabled.

Did you find this useful ?

No (0)

Yes (1)

100%

100% of users found this answer useful

Other answers

Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

Looks like xml. Try taking the text/plain, */* out of the accept in the request

RAJESH L.
RAJESH L.

RAJESH L.

Level
0
12 / 100
points

Thanks, I tried that too, but it did not work.