#### login.http
# @name login
@url = https://myawesomesite.com
POST {{url}}/api/auth HTTP/1.1
{
"username":"user",
"pass": "pass"
}
Then you could import/require files like:
import './login.http'
GET {{url}}/api/list HTTP/1.1
Authorization: Bearer {{login.response.body.$.data.id}}
@mtxr nice suggestion, I will consider it carefully.
Any update on this?
I am so sorry that I'm busy in my work, and I also put the feature that file variable can reference other variable in first priority
Hi, any update on this? Really looking forward for this feature
Hi, this feature would be really helpful to write DRY request files.
Currently I'm repeating the auth.http content in every .http file...
This features would be really cool.
I'm interested in this, if you have any ideas on how you want to do it. i can help you build it out.
Any Update on this ??? , I am really looking forward to it
@dv29 want to try some implementation and get feedback?
I'm also very interested in this, and thinking about giving it a shot. But first, we need to agree on a few things.
I would prefer to follow the pattern of prefixing keywords with @ inside a comment, like it is done with @name. So what do you think about the following?
# @import './login.http'
GET {{url}}/api/list HTTP/1.1
Authorization: Bearer {{login.response.body.$.data.id}}
I see that we have a few options: include, import, require.
My personal preference is for include, since this is basically going to be treated like a preprocessor include, as if we had copied and pasted the code into the new file. Any objections?
http language definition to support the new include/import/require statement@include statement?Anything else?
@rdumont : Happy to see you're planning to work on this.
Pls keep us informed.
@rdumont we're also very much interested in this feature, please let us know of the progress! :)
+1
Most helpful comment
Hi, this feature would be really helpful to write DRY request files.
Currently I'm repeating the
auth.httpcontent in every.httpfile...