Vscode-restclient: Hole Body includes apostrophe, breaks further requests

Created on 10 Oct 2018  路  6Comments  路  Source: Huachao/vscode-restclient

  • VSCode Version: 1.28
  • OS Version: Windows 10
  • REST Client Version: latest

grafik

I am using the new great feature "Request Variables".
Look at the image.

I need the body but without trailing apostrophe because this breaks subsequent uses..

bug

All 6 comments

Example Response:
```HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Date: Wed, 10 Oct 2018 14:45:08 GMT
Content-Length: 315

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiaW5mb0BhbWFubmluZm9ybWF0aWsuY2giLCJleHAiOiIxNTM5MTg0NTA4IiwibmJmIjoiMTUzOTE4MjcwOCIsIlVzZXJJZCI6IjUwMDE4Yjk1LWUxM2MtNGE0My04OTQ0LWYxNWUxZjkyMjg1ZSJ9.disUIIcm6bVT43VRx9WPL1iB5_9UTBBRhH9uPdRncvw"

@pungggi nice catch, this JSON response body of string value is a special case for JSONPath, some libraries can support syntax like $ to parse in this case, for request variable syntax it will go like {{tokenResponse.response.body.$}}. However, the library I use doesn't handle this weill, I will try to search a better one. And the way you use here {{tokenResponse.response.body.*}}, for * I will not do any pasring logic, just return the body string I received.

Hi @Huachao Any news on this?

@pungggi @jerkovicl Sorry for the late update. I have fixed the issue by replacing the original jsonpath package, and you can reference the string value with json path $, as for your case, the full variable value should be {{tokenResponse.response.body.$}}

@pungggi @jerkovicl you can try this in latest version 0.22.0

Thank you! Works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gjoforte picture gjoforte  路  4Comments

rohitkrishna094 picture rohitkrishna094  路  3Comments

AresAndy picture AresAndy  路  3Comments

Marvin-Brouwer picture Marvin-Brouwer  路  3Comments

mchelen picture mchelen  路  4Comments