Files
neovim/runtime/doc
Tom Ampuero 7cd5356a6f feat(net): vim.net.request(), :edit [url] #34140
Problem:
Nvim depends on netrw to download/request URL contents.

Solution:
- Add `vim.net.request()` as a thin curl wrapper:
  - Basic GET with --silent, --show-error, --fail, --location, --retry
  - Optional `opts.outpath` to save to a file
  - Operates asynchronously. Pass an `on_response` handler to get the result.
- Add integ tests (requires NVIM_TEST_INTEG to be set) to test success
  and 404 failure.
- Health check for missing `curl`.
- Handle `:edit https://…` using `vim.net.request()`.

API Usage:
1. Asynchronous request:

    vim.net.request('https://httpbingo.org/get', { retry = 2 }, function(err, response)
      if err then
        print('Fetch failed:', err)
      else
        print('Got body of length:', #response.body)
      end
    end)

2. Download to file:

    vim.net.request('https://httpbingo.org/get', { outpath = 'out_async.txt' }, function(err)
      if err then print('Error:', err) end
    end)

3. Remote :edit integration (in runtime/plugin/net.lua) fetches into buffer:

    :edit https://httpbingo.org/get
2025-07-13 13:43:11 -07:00
..
2023-07-25 05:07:13 -07:00
2025-07-10 21:50:46 -04:00
2025-07-10 21:50:46 -04:00
2025-07-10 21:50:46 -04:00
2025-05-03 10:08:53 -07:00
2024-05-15 23:19:26 +02:00
2025-04-27 15:44:11 -07:00
2025-07-10 21:50:46 -04:00
2025-06-14 17:24:36 +02:00
2023-06-25 17:14:28 +02:00
2025-07-10 21:50:46 -04:00
2025-07-10 21:50:46 -04:00
2025-07-07 17:31:37 -07:00
2025-07-10 21:50:46 -04:00
2025-06-14 17:24:36 +02:00
2025-05-03 10:08:53 -07:00
2022-10-14 08:01:13 -07:00
2025-06-18 12:13:55 +02:00
2025-03-30 13:29:36 -07:00
2025-06-01 14:13:50 -07:00
2025-07-10 22:36:16 -04:00
2024-11-21 06:50:30 +08:00
2025-05-03 15:47:59 -07:00
2025-06-18 12:12:23 +02:00
2024-01-18 00:14:48 -08:00
2025-07-10 21:50:46 -04:00
2023-01-01 15:05:13 +01:00
2025-03-15 15:00:44 +01:00
2025-04-27 13:40:46 -07:00
2025-07-10 21:50:46 -04:00
2025-05-03 15:47:59 -07:00
2023-08-10 17:28:02 +08:00
2025-07-08 05:28:12 -07:00
2025-01-03 08:29:36 -08:00
2024-04-23 08:20:36 +08:00
2024-05-11 18:14:03 +08:00
2023-04-23 15:22:55 +02:00
2023-01-03 10:07:43 +00:00
2023-06-25 17:14:28 +02:00
2023-06-25 17:14:28 +02:00
2023-06-25 17:14:28 +02:00
2023-06-26 11:29:12 +02:00
2025-07-10 21:50:46 -04:00
2023-07-25 05:07:13 -07:00
2025-06-18 12:12:23 +02:00
2023-06-19 08:40:33 -07:00
2025-05-03 15:47:59 -07:00
2025-07-10 21:50:46 -04:00
2025-03-18 06:18:37 -07:00