Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.32k stars 445 forks source link

The gzip-compressed JSON data transmitted by the backend is not available to the variables. #1258

Open qcyblm opened 8 months ago

qcyblm commented 8 months ago

Steps to Reproduce:

  1. Create POST request
    
    ###
    # @name loginToken
    POST http://{{host}}:{{port}}/api/public/sign_in
    Content-Type: application/x-www-form-urlencoded
    Accept-Encoding: gzip, deflate, br

name={{name}} &password={{password}}

@token = {{loginToken.response.body.data.token}} GET http://{{host}}:{{port}}/api/private/login_log Authorization: Bearer {{token}} Accept-Encoding: gzip, deflate, br


2. Send Request loginToken

HTTP/1.1 200 OK content-encoding: gzip date: Thu, 28 Mar 2024 04:01:03 GMT connection: close content-length: 244

{"statusCode":200,"message":"success","data":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwibmFtZSI6InFjeWJsbSIsImlhdCI6MTcxMTU5ODQ2MywiZXhwIjoxNzEyMjAzMjYzfQ.vtwrMd7ZQpN9fId98ESpiNt2OVKU065_w1TvSlV8a5Y"}}


3.  Alerts for errors
`@token = {{loginToken.response.body.data.token}}`
Only JSON and XML response/request body is supported to query the result