A simple HTTP client for Neovim that you edit like a buffer
NOTE: rest.nvim requires you to have curl installed and added to your PATH
vim.pack.add({ src = "https://github.com/grqphical/rest.nvim" })
{
"grqphical/rest.nvim",
}
To create a new request, run the command :NewRequest
. This will open a new empty buffer where you can start
writing out the parameters of your request. Below is an example of a request:
url: https://httpbin.org/post
method: POST
header: Content-Type: application/json
body: {"foo":"bar"}
You can read more about the rest.nvim
request language on the wiki
To send the request, simply write the buffer with :w
and the HTTP response will appear in a new buffer
Since rest.nvim
is a frontend for curl, you can send entire files in the body of a request with:
body: @file.txt
If you have a request or a response you wish to save to a file simply run :RestSave
, optionally add a file path and rest
will save the contents of the current request/response to a file
If you wish to configure rest.nvim
use the code below in your init.lua
:
require("rest").setup {
-- configuration here
}
You can read more about configuring rest.nvim
on the wiki
rest.nvim
is licensed under the MIT License