-
Hey 👋🏻 Apologies, I am learning Rust from Python... Forgive me if this is a trivial question to answer. Loving using this crate! I would really appreciate some advice 🙏🏻 My application loads an environment variable and I use this variable as a bearer token for authorisation. I am able to do this with I want to do the the following:
Is this the correct approach? I am not sure how people are using On a separate note, I want to instantiate a client and use it for multiple requests. Is the most simple way to do this to create a "Client Singleton" of sorts? I want to tie the client to the functions I need to use it in. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Just as I wrote this, I managed to get it to work. I needed to unwrap I would still love advice on the second part of my question 🙏🏻 |
Beta Was this translation helpful? Give feedback.
-
Yes, that's how I would personally do it. If all my requests could use the same config, I'd create one |
Beta Was this translation helpful? Give feedback.
-
Awesome, thanks 🙏🏻 |
Beta Was this translation helpful? Give feedback.
Just as I wrote this, I managed to get it to work. I needed to unwrap
from_str
... I could thenset_sensitive
.I would still love advice on the second part of my question 🙏🏻