How to in .http file add automatically headers to all requests?



I move my API requests from Postman to Rider and try to use .http files.
I would like to have an option to define default headers for all my API requests,
but I don't see the one in the documentation on page

In general, I would like to include them per request

POST {{base_url}}/my_endpoint
{{ my_headers }}


   "id": 100


or (better) per file/folder/project:

@include_headers {{ my_headers }}


GET /request1


GET /request2



Best regards,
Dariusz Jankowski


No, I know how to define variables. The problem is about headers, how to define them in one place (file, variables, environment, etc.) and use in all (or some) requests.

Probably, the best way would by to add command on the top of a file:

so every request defined in the file will include them also.


Please sign in to leave a comment.