Improve documentation on netRcHeaders method (#1854)

This commit is contained in:
Daniel Chao
2026-09-09 15:30:08 -07:00
committed by GitHub
parent c95b3d11f4
commit 90245589b6
+14
View File
@@ -307,6 +307,20 @@ class Http {
/// ``` /// ```
/// headers = netRcHeaders(read("/path/to/.netrc")) /// headers = netRcHeaders(read("/path/to/.netrc"))
/// ``` /// ```
///
/// This largely follows how [curl](https://everything.curl.dev/usingcurl/netrc.html) parses netrc
/// files:
///
/// * Values can optionally be quoted.
/// * Quoted values can include `\"`, `\n`, `\r`, and `\t` to represent double quote, newline,
/// carriage return, and tab.
/// * Lines starting with `#` are treated as comments.
/// * "macdef" sections are ignored.
///
/// Additionally, the following rules are applied:
///
/// * The "default" section is ignored.
/// * Machine names that contain `/` are ignored.
@Since { version = "0.33.0" } @Since { version = "0.33.0" }
external function netRcHeaders( external function netRcHeaders(
contents: String | Resource, contents: String | Resource,