diepm / vim-rest-console

A REST console for Vim.
658 stars 54 forks source link

Make multiple http request inside a REST request block #21

Closed q12321q closed 8 years ago

q12321q commented 8 years ago

When I look at your sample.rest you repeat http://localhost:9200 many times. I'm lazy. What I would like to be able to do is to write the host just one time and then have multiple rest requests with the same host and headers:

# Submitting a form.
http://localhost:9200

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

GET /_cat/nodes?v
POST /testindex/testtype
{
    "name": "some name",
    "value": "some value",
    "date": "2015-01-01"
}
GET /testindex/_search?pretty
#end of the block

When I trigger on the POST or its body it'll execute the POST request with the host and header defined above.

What do you think?

q12321q commented 8 years ago

Sorry It duplicates the pull request (Allow the definition of global host and headers)...

diepm commented 8 years ago

Yup, I'm lazy, too. That's why this feature is slow to come but it's here anyway! Let's type less ;)