← til

Making HTTP requests from Vim

January 26, 2019
vim

After discovering that there is a Visual Studio code plugin which enables HTTP requests from inside the editor, I was delighted to find that there's also a Vim plugin for that.

Who needs Postman or httpie when you can do it from your editor like this:

GET http://httpbin.org/get HTTP/1.1

Accept: application/json

Just hit :Http and you'll get a nicely formatted response:

HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.9.0
Date: Sat, 26 Jan 2019 17:53:00 GMT
Content-Type: application/json
Content-Length: 303
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Via: 1.1 vegur

{
  "args": {}, 
  "headers": {
    "Accept": "*/*", 
    "Connection": "close", 
    "Content-Length": "24", 
    "Content-Type": "application/x-www-form-urlencoded", 
    "Host": "httpbin.org", 
    "User-Agent": "curl/7.54.0"
  }, 
  "url": "http://httpbin.org/get"
}