/
View dependency graph
Depends on
- dh-cargo (dh-sequence-cargo)
- cargo, debhelper-compat, librust-shellexpand-3+base-0-dev, librust-shellexpand-3+path-dev, librust-shellexpand-3+tilde-dev, librust-thiserror-1+default-dev, libstd-rust-dev, rustc
README (full)
netrc
A netrc library for Rust, with support for reqwest via reqwest-middleware.
reqwest-netrc
The reqwest-netrc crate is a middleware for reqwest
to support the netrc file.
Usage
To bring this crate into your repository, either add reqwest-netrc to your
Cargo.toml, or run:
> cargo add reqwest-netrc
Example
The common scenario is to have a ~/.netrc file or the NETRC environement variable defined:
use reqwest::Client;
use reqwest_middleware::ClientBuilder;
use reqwest_netrc::NetrcMiddleware;
// ...
let client = ClientBuilder::new(Client::builder().build().unwrap())
.with_init(NetrcMiddleware::new().unwrap())
.build();
let res = client.get("https://domain.io/api/hello").send().await;
// ...
rust-netrc
The rust-netrc crate is a parser for the netrc files.
Usage
To bring this crate into your repository, either add rust-netrc to your
Cargo.toml, or run:
> cargo add rust-netrc
Example
use netrc::Netrc;
fn main() {
let nrc = Netrc::new().unwrap();
for (host, auth) in nrc.hosts {
println!("{host}: {auth:?}");
}
}
Contributing
Feedback and contributions are very welcome.
License
This project is licensed under MIT.
| dir | debian/ |
| dir | src/ |
| file | .cargo_vcs_info.json |
| file | .gitignore |
| file | Cargo.toml |
| file | Cargo.toml.orig |
| file | LICENSE |
| file | README.md |