handle non json body in intellij idea http client editor .http files

Answered

I am trying to use http client editor for connect multiple requests. but stuck at a point where if my response from first request is not json IntelliJ throws a syntax error.

###
POST {{host}}/AccessToken.sor.v2
Authorization: claims app_authorization={{token}}
correlation-id: 34041a02-a3d0-4fcd-9f90-a0e8f379b532
Content-Type: application/json

{
"productType": "ABC"
}
> {%
client.global.set("bearer_token", response.body);
%}
#####

 

response from service is Bearer b83aac93-63f0-3247-ba5e-2556e4cdbb64 and I cannot change it to json format.

<eval>:1 SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found B
Bearer b83aac93-63f0-3247-ba5e-2556e4cdbb64
0
1 comment

Hi Kishore, thanks for taking the time to report this.

Please vote for https://youtrack.jetbrains.com/issue/IDEA-263801

I added your case to the YT ticket too.

See this article if you are not familiar with YouTrack.

0

Please sign in to leave a comment.