tanhakabir / rest-book

REST Book is a Visual Studio Code extension that allows you to perform REST calls in a Notebook interface.
https://marketplace.visualstudio.com/items?itemName=tanhakabir.rest-book
MIT License
248 stars 24 forks source link

Unable to sent cookies to a endpoint from a variable #131

Open DarylStark opened 2 years ago

DarylStark commented 2 years ago

I'm trying to sent a cookie to a endpoint that I received in a previous call.

For example; I first send a request to my login endpoint

let login = POST http://localhost:5000/login

{
    "username": "user1",
    "password": "xxx"
}

The response contains a cookie in the headers with the session

Set-Cookie    0: session=very_long_session_id; HttpOnly; Path=/

Next, I want to send this cookie to other endpoints;

GET http://localhost:5000/endpoint
Cookie: $login.headers.Set-Cookie[0]

But the RESTbook send the literal string $login.headers.Set-Cookie[0] instead of the value that was in the first cookie. When I drop the [0] index of the variable, it sends the complete string, including the ['s and "'s. It should send the cookie from the request.