|
1 | | -*nurl.nvim.txt* For Neovim >= 0.10.0 Last change: 2026 January 17 |
| 1 | +*nurl.nvim.txt* For Neovim >= 0.10.0 Last change: 2026 January 21 |
2 | 2 |
|
3 | 3 | HTTP client for Neovim. Requests in pure Lua. Programmable, composable, |
4 | 4 | extensible. |
@@ -196,6 +196,13 @@ A request file returns a list of request tables: |
196 | 196 | ["Content-Type"] = "application/json", |
197 | 197 | }, |
198 | 198 |
|
| 199 | + -- Auth (optional) |
| 200 | + auth = { |
| 201 | + type = "basic", |
| 202 | + username = "user", |
| 203 | + password = "pass", |
| 204 | + }, |
| 205 | + |
199 | 206 | -- Body (optional, use only one) |
200 | 207 | data = { key = "value" }, -- table: JSON encoded |
201 | 208 | data = '{"raw": "json"}', -- string: sent as-is |
@@ -566,6 +573,7 @@ The expanded request object (all functions resolved): |
566 | 573 | ---@field query? table<string,any> Query parameters (URI-encoded) |
567 | 574 | ---@field title? string Display name |
568 | 575 | ---@field headers table<string,string> Headers |
| 576 | + ---@field auth? nurl.BasicAuth Auth configuration |
569 | 577 | ---@field data? string|table Request body |
570 | 578 | ---@field form? table<string,string> Form data |
571 | 579 | ---@field data_urlencode? table URL-encoded data |
@@ -599,6 +607,16 @@ Passed to `post_hook` and `callback`: |
599 | 607 | < |
600 | 608 |
|
601 | 609 |
|
| 610 | +NURL.BASICAUTH *nurl.nvim-type-reference-nurl.basicauth* |
| 611 | + |
| 612 | +>lua |
| 613 | + ---@class nurl.BasicAuth |
| 614 | + ---@field type "basic" |
| 615 | + ---@field username string |
| 616 | + ---@field password string |
| 617 | +< |
| 618 | + |
| 619 | + |
602 | 620 | NURL.RESPONSE *nurl.nvim-type-reference-nurl.response* |
603 | 621 |
|
604 | 622 | Parsed HTTP response: |
|
0 commit comments