Skip to content

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.

License

Notifications You must be signed in to change notification settings

askfiy/http-client.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

README

http-client.nvim

Elegant neovim request client implementation

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.

Features

Isn't it better to be simple?

  • Pure asynchronous support
  • Simple configuration
  • Clear structure
  • A small amount of dependency

Install and Use

Important

Please ensure the following dependencies are installed:

To install using lazy.nvim:

{
    "askfiy/http-client.nvim",
    config = function()
        require("http-client").setup()
    end,
}

Important

For usage examples, see: test.http

Default Configuration

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,
    },
}

Plugin Commands

The plugin provides 3 commands:

  • HttpClient lastRender - Renders the last request result
  • HttpClient lastRequest - Resends the last request
  • HttpClient sendRequest - Sends the request under the current cursor
  • HttpClient stopRequest - Stop all active request

Project Structure

A clear project structure is key to easy maintenance and contributions:

Similar

rest.nvim and kulala.nvim do a very good job. They are all excellent plugins of the same type:

License

This plugin is licensed under the MIT License. See the LICENSE file for details.

Contributing

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.

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages