-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to attach header to request #1792
Comments
You can create a If you want, the reqwest library has convenience methods for basic auth, among plenty of other client utilities you may normally expect. |
Thanks a bunch (and the plug for reqwest. Unfortunately, the OpenSSL dependency will not work in my situation as I am trying to find a minimal dependency solution). On that note, another question I have is does |
@gilgameshskytrooper hyper-tls does, but rustls via hyper-rustls would allow you to avoid the OpenSSL dependency. |
O ok. Thanks a bunch. |
reqwest uses native-tls by default (which uses openssl on Linux), but it's possible to build reqwest without TLS by setting |
If i need to access a TLS encrypted endpoint, will Like i am talking about something like Go's stdlibs http package will handle TLS handshakes and whatnot with native Go code (crypto/x509) without relying on OpenSSL? |
Without enabling the reqwest = { version = "0.9", default-features = false, features = ["rustls-tls"] } To get something like Go. rustls is a library built on ring, a gradual translation of Google's BoringSSL into Rust. |
I see. Thank you |
I apologize in advance if my question is stupid since I am new to Rust coming from a mostly Go background.
I am trying to attach a basic auth header like the following curl command
curl -u "api_key:api_token" https://api.voiceit.io/users
My question is how can I attach the headers
HeaderMap
object to my client/HTTP GET request. I went over your docs at https://docs.rs/hyper/0.12.25/hyper/struct.HeaderMap.html and I can't find the documentation of how to attach this to an actual request.Thank you
The text was updated successfully, but these errors were encountered: