Crate sysreq

Source
Expand description

Simple, virtually-zero-dependencies HTTP client wrapping a system client.

“Virtually-zero” means no unnecessary runtime dependencies. The only runtime dependency, other than std, is URL validation, which is required for security reasons.

§Supported Backends

  • wget
  • cURL
  • PowerShell (Invoke-WebRequest)

§Usage

In your Cargo.toml:

[dependencies]
sysreq = "0.1"

In your code:

let html = sysreq::get("https://www.rust-lang.org/").unwrap();
println!("{}", String::from_utf8_lossy(&html));

Structs§

RequestBuilder
A builder for a request

Enums§

Error
Errors that sysreq can return
SystemHttpClient
System HTTP clients supported by sysreq

Functions§

get
Perform a GET request to the given URL
http_client
Returns the system’s compatible HTTP client used for requests, if one is installed.
installed
Returns whether the system has a compatible HTTP client installed
supported_http_clients
Returns a list of supported system HTTP clients