Can I refer to cookies in IntelliJ's HTTP Client?


I'm using IntelliJ's HTTP Client to test some API calls. However, in my application I enabled CSRF protection, so with each request I get a X-XSRF-TOKEN cookie that I should pass it as the value of the X-XSRF-TOKEN header.

At the moment, my workflow is the following:

  1. Execute the API
  2. Copy the cookie from .idea/httpRequests/http-client.cookies
  3. Paste the cookie in the variables of my environment
  4. And repeat

Is there a way to reference cookies in a request like we can reference variables? For example something like:

POST http://localhost:8080/api/user
Accept: application/json
Content-Type: application/json
X-Csrf-Token: {{Cookie:X-XSRF-TOKEN}}

{"email": "", "password": "my password"}

For now, there is no possibility of doing it. It will be possible to cover that case after implementing this issue:

Please see if you're not familiar with YouTrack.