Hacker News new | ask | show | jobs
by philliphaydon 1337 days ago
Can you chain requests together? Like if a request requires auth it will invoke login then take the token for use in the next request.
2 comments

I haven't used it myself, but there is an option to parse responses with JavaScript and set variables.

  GET https://httpbin.org/get
  
  > {%
      client.global.set("my_cookie", response.headers.valuesOf("Set-Cookie")[0]);
  %}
https://www.jetbrains.com/help/idea/exploring-http-syntax.ht...
Interesting. I have 2 endpoints (login and get settings) I use for testing in a desktop app and sometimes firing up insomnia for that project is a hassle. But rider has that rest client too so maybe I’ll try it for this one thing.
Well... that's called programming, no? :)