Skip to main content

Crate rsurl

Crate rsurl 

Source
Expand description

rsurl — a pure-Rust implementation of curl.

Top-level entry points:

  • HTTP/HTTPS — get, request, or Request / Response directly.
  • Any supported scheme — transfer, which dispatches to the right protocol backend and returns the payload as raw bytes.

Modules§

dict
DICT protocol (RFC 2229).
ffi
C ABI for rsurl.
file
file:// URL support (RFC 8089, formerly RFC 1738).
ftp
FTP and FTPS support.
gopher
Gopher and Gopher-over-TLS support (RFC 1436 + the TLS extension).
http2
HTTP/2 support (RFC 9113), with HPACK header compression (RFC 7541).
http3
HTTP/3 support (RFC 9114), with QPACK (RFC 9204) over QUIC (RFC 9000).
imap
IMAP and IMAPS support.
ldap
LDAP and LDAPS support.
mqtt
MQTT and MQTTS support.
pop3
POP3 and POP3S support.
rtsp
RTSP support (RFC 7826, also RFC 2326 for RTSP/1.0).
ssh
SSH transports: SFTP (sftp://) and SCP (scp://), download and upload.
tftp
TFTP support (RFC 1350, plus RFC 2347 option extension, RFC 2348 blksize, RFC 2349 timeout/tsize).
tls
TLS support, with a pluggable backend.
websocket
WebSocket support (RFC 6455).

Structs§

Cookie
One parsed cookie. expires is a Unix epoch second; None means a session cookie (lives only for this rsurl invocation, never persisted).
CookieJar
Bag of cookies. Cheap to clone in tests; threaded by &mut through the redirect chain in crate::Request::send_with_jar.
ProxyConfig
Where to route HTTP(S) traffic through. Parsed from a curl-style proxy URL — typically http://user:pass@host:port. Only http:// proxies are supported in this milestone; TLS-to-proxy (https://) and SOCKS are rejected with Error::UnsupportedScheme.
Request
An HTTP request being constructed.
Response
A complete HTTP response.
Url
Minimal parsed URL. Only the fields we need for the protocols we speak.

Enums§

Error
Errors that can occur during a rsurl request.
HttpVersionPref
Preference for which HTTP version to use over HTTPS. The HTTPS dispatcher picks this up. HTTP/2 is selected via ALPN at TLS-handshake time; if the server doesn’t agree (Auto) we transparently fall back to HTTP/1.1. HTTP/3 runs over a wholly separate QUIC/UDP path (see crate::http3).

Functions§

get
Perform an HTTP GET against url and return the full response.
request
Perform an arbitrary HTTP request. Convenience wrapper over Request.
send_multiplexed
Issue several HTTP/2 requests concurrently over a single connection using true stream multiplexing, returning one result per request in input order.
transfer
Run the default operation for the URL’s scheme and return its payload.
transfer_url
Same as transfer but starts from an already-parsed URL.

Type Aliases§

Result
Crate-wide result alias.