Skip to main content

Module net

Module net 

Source
Expand description

HTTP/HTTPS networking builtins โ€” download.file() and url().

Provides TLS support via rustls with system certificate trust (rustls-native-certs) and Mozilla root certificates (webpki-roots).

download.file(url, destfile) performs a one-shot HTTP/HTTPS GET request and writes the response body to a local file.

url(description) creates a URL connection object that can be read with readLines().

Structsยง

ParsedUrl ๐Ÿ”’
Parsed URL components for HTTP/HTTPS.

Enumsยง

Scheme ๐Ÿ”’

Staticsยง

__INTERP_REG_INTERP_DOWNLOAD_FILE ๐Ÿ”’
__INTERP_REG_INTERP_URL ๐Ÿ”’

Traitsยง

ReadWriteStream ๐Ÿ”’
Trait alias for streams that are both Read and Write.

Functionsยง

connect_stream ๐Ÿ”’
Open a TCP connection and optionally wrap it in TLS. Returns a boxed Read+Write stream.
connection_value ๐Ÿ”’
Build an integer scalar with class "connection" representing connection id.
find_header_end ๐Ÿ”’
Find the position of \r\n\r\n in bytes (end of HTTP headers).
http_get ๐Ÿ”’
Perform an HTTP GET request on the given stream, returning the response body as bytes.
interp_download_file ๐Ÿ”’
Download a file from a URL.
interp_url ๐Ÿ”’
Create a URL connection.
parse_status_code ๐Ÿ”’
Parse the HTTP status code from a status line like โ€œHTTP/1.1 200 OKโ€.
parse_url ๐Ÿ”’
Parse a URL into its components. Only supports http:// and https://.
tls_client_config ๐Ÿ”’
Build a rustls ClientConfig using system certificates (via rustls-native-certs) with Mozilla roots as fallback (via webpki-roots).