http-client.nvim is a Neovim plugin designed to help users quickly and easily send HTTP requests directly from within Neovim.
The plugin supports multiple request formats and file uploads, offering developers a flexible and efficient way to manage HTTP interactions.
Isn't it better to be simple?
- Pure asynchronous support
- Simple configuration
- Clear structure
- A small amount of dependency
To install using lazy.nvim:
{
"askfiy/http-client.nvim",
config = function()
require("http-client").setup()
end,
}
Important
For usage examples, see: test.http
http-client.nvim provides some default configuration options, keeping the setup as simple as possible:
local config = {
client = "curl",
animation = {
spinner = { "|", "/", "-", "\\" },
interval = 100,
},
extmark = {
still = {
virt_text = "Send Request",
hl_group = "Comment",
},
active = {
virt_text = "Sending",
hl_group = "Comment",
},
},
render = {
open = {
width = nil, -- nil | number
height = nil, -- nil | number,
focus = true,
},
keybinds = {
help = "?",
copy_curl_command = "<leader>cp",
},
},
hooks = {
process_request = function(request)
return request
end,
process_response = function(response)
return response
end,
process_template_render = function(request, response, template)
return template
end,
process_exception_render = function(request, response, template)
return template
end,
},
}
The plugin provides 3 commands:
HttpClient lastRender
- Renders the last request resultHttpClient lastRequest
- Resends the last requestHttpClient sendRequest
- Sends the request under the current cursorHttpClient stopRequest
- Stop all active request
A clear project structure is key to easy maintenance and contributions:
rest.nvim and kulala.nvim do a very good job. They are all excellent plugins of the same type:
This plugin is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! If you encounter a bug or want to enhance this plugin, feel free to open an issue or create a pull request.