HTTP Requests - scripting http headers

When using a ".http" file, I know I can write a script to do something with the response, like pull out a value and store it for use in later requests.

I would like to make an HTTP request where one of the headers is time sensitive.  Is it possible for me to write a script to generate the header and then somehow reference it in the header?  Ideally as part of the request.  E.g.

GET http://blah/blah
X-My-Custom-Header: > {% <my code> %}

I've got several http methods in the same file that will all want to do this sort of thing.  There are also quite a few lines in the script to generate the header so I would really need to be able to put it in an external script or something.

Is this possible?  I know I can have work the script into the response of a previous request, but it's just a bit too fiddly.

Comment actions Permalink

Thanks -voted.  Hopefully we'll see something implemented in the near future.


Please sign in to leave a comment.