{"id":13897197,"url":"https://github.com/blacklight/nvim-http","last_synced_at":"2025-04-15T12:14:25.896Z","repository":{"id":152616068,"uuid":"623197170","full_name":"blacklight/nvim-http","owner":"blacklight","description":"An HTTP client for neovim inspired by vscode-restclient and the IntelliJ HTTP client","archived":false,"fork":false,"pushed_at":"2025-04-02T15:31:24.000Z","size":55,"stargazers_count":106,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T12:14:13.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blacklight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-03T22:25:55.000Z","updated_at":"2025-04-04T18:54:04.000Z","dependencies_parsed_at":"2024-06-06T02:46:03.919Z","dependency_job_id":"a0d2a418-6d2d-4349-97e8-fb033d8262c8","html_url":"https://github.com/blacklight/nvim-http","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklight%2Fnvim-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklight%2Fnvim-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklight%2Fnvim-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklight%2Fnvim-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blacklight","download_url":"https://codeload.github.com/blacklight/nvim-http/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249067779,"owners_count":21207396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T18:03:25.047Z","updated_at":"2025-04-15T12:14:25.888Z","avatar_url":"https://github.com/blacklight.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# nvim-http\n\nYou can use this plugin to run HTTP requests directly in your favourite text\neditor.\n\n![Screen recording of the plugin running an HTTP request](https://user-images.githubusercontent.com/42405/231295219-c7715fb0-85d1-4183-8252-c8b670f59976.gif)\n\nThis plugin is inspired by the\n[vscode-restclient](https://github.com/Huachao/vscode-restclient) extension and\nthe [IntelliJ HTTP\nClient](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html).\n\nIt is a more advanced alternative to\n[vim-http](https://github.com/nicwest/vim-http), but it comes closer to the\nVSCode and IntelliJ alternatives because of the following features:\n\n1. It supports environment variables.\n2. It uses Neovim's `async_call` mechanism, so the request is not blocking for\n   the editor, and it can be stopped at any time.\n3. An extended syntax for the `.http` files, with support for JSON and HTML\n   blocks in the requests and the responses, as well as comments.\n4. Real support for multi-request buffers - it matches the request that\n   surrounds the cursor, while supporting visual selection as well.\n\n## Installation\n\nAdd the plugin to your Neovim configuration through your favourite plugin\nmanager. For example:\n\n```vim\nPlug 'blacklight/nvim-http'\n```\n\nYou may need to run `:UpdateRemotePlugins` after installing the plugin.\n\n### Dependencies\n\nThe plugin's core is in Python and it uses the\n[`requests`](https://github.com/psf/requests) library to perform the requests.\n\nThe plugin therefore requires:\n\n- The [`pynvim`](https://github.com/neovim/pynvim) bindings\n  - `pip install pynvim`\n  - On Arch-based distros: `[sudo] pacman -S python-pynvim`\n  - On Debian-based distros: `[sudo] apt install python3-pynvim`\n  - On Red Hat-based distros: `[sudo] yum install python-pynvim`\n- The [`requests`](https://github.com/psf/requests) Python library\n  - `pip install requests`\n  - On Arch-based distros: `[sudo] pacman -S python-requests`\n  - On Debian-based distros: `[sudo] apt install python3-requests`\n  - On Red Hat-based distros: `[sudo] yum install python-requests`\n\n## Usage\n\nOpen a buffer and add the body of your HTTP request. If the file name in the\nbuffer has the `.http` extension, then the plugin will automatically highlight\nits syntax, and you can also set up nice automation on the file type.\n\nTo run your request:\n\n1. Position the cursor anywhere in the body, or visually select the whole body.\n2. Run the `:Http` command.\n\nThe response will be shown in a `vsplit` buffer by default. Use the `:Http -h`\nif you want to show the response in a horizontal split instead, or `:Http -t` if\nyou want to show it in a new tab.\n\nThe default request timeout is 10 seconds, but you can change it by setting the\n`-T`/`--timeout` flag, e.g. `:Http -T 5`.\n\nBy default the request will follow HTTP redirects, but you can disable this\nthrough the `--no-redirects` flag.\n\nIf you want to interrupt the current request, use the `:HttpStop` command.\n\n### Multiple requests\n\nLike the `vim-http`, this plugin supports running requests both in normal and in\nvisual mode - in the latter case, only the selected range will be interpreted as\na request.\n\nHowever, like the VSCode and IntelliJ plugins, it also supports multiple\nrequests in the same file in normal mode.\n\nAny line starting with the triple hashtag will be interpreted as a request\nseparator:\n\n```http\n### The first request\n\nPOST {{base_url}}/api/v1/users HTTP/1.1\nAuthorization: Bearer {{jwt_token}}\n\n{\n  \"name\": \"Alice\"\n}\n\n### The second request\n\nGET {{base_url}}/api/v1/users?name=Alice HTTP/1.1\nAuthorization: Bearer {{jwt_token}}\n\n### ...more requests\n```\n\nWhen `:Http` is run in normal mode, it will detect the boundaries of the\nsurrounding request and only execute that request.\n\n### Keyboard shortcuts\n\nYou can bind the `:Http` command to a key combination in your `init.vim`.\n\nFor example, to run the `:Http` command when pressing `Enter` in normal mode and\nin visual mode, if the current buffer contains an `.http` file:\n\n```vim\nau FileType http nmap \u003cCR\u003e :Http\u003cCR\u003e\nau FileType http vmap \u003cCR\u003e :\u003cC-U\u003eHttp\u003cCR\u003e\n```\n\n\n### Environment files\n\n#### JSON files\n\nThis plugin is compatible with environment files generated by the VSCode\nextension. Any file matching the `*.env.json` pattern stored in the same folder\nas the `.http` file (or the current working directory) will be interpreted as an\nenvironment file. Example format:\n\n```json\n{\n  \"dev\": {\n    \"base_url\": \"http://localhost:3000\",\n    \"jwt_token\": null\n  },\n  \"prod\": {\n    \"base_url\": \"https://foobar.eu-west.some-cloud.com\",\n    \"jwt_token\": \"SECRET\"\n  }\n}\n```\n\nIf multiple environment files are detected, or there are files with more than\none environment, then the `:Http` command will prompt the user for which\nenvironment they want to use before executing the request.\n\n#### `.env` files\n\nAdditionally, the plugin also supports environment variables defined in the\n`.env` file in the same folder as the `.http` file. Note that the `.env` file\ndoesn't support multiple environments, so it will be used as the default.\n\nA combination of JSON and `.env` files is also supported. In this case, all the\nvariables from the `.env` file will be loaded first, and inherited by all the\nJSON profiles.\n\n#### Using environment variables\n\nThe environment variables can then be wrapped as ``{{varname}}`` in the buffer:\n\n```\nGET {{base_url}}/api/v1/users?limit=10\nAuthorization: Bearer {{jwt_token}}\n```\n\n### Inline shell commands\n\nYou can also use inline shell commands in the `.http` file, or in the environment\nvariables. The commands will be executed by the shell and the output will be used\nin the request.\n\nFor example:\n\n```http\n###\n\nGET {{URL}}/api/v1/users/$(echo $USER)\n\n###\n\nGET {{URL}}/api/v1/users/me\nAuthorization: Bearer $(gopass show api/token)\nRequested-By: $(whoami)\nRequested-At: $(date)\n\n###\n```\n\nOr:\n\n```bash\n# .env\nTOKEN=$(gopass show api/token)\n```\n\n```http\n###\n# request.http\nGET {{URL}}/api/v1/users/me\nAuthorization: Bearer {{TOKEN}}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacklight%2Fnvim-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacklight%2Fnvim-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacklight%2Fnvim-http/lists"}