-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I am trying to convert some code to use rustify and i cannot find a way to add basic_auth. I can use Middleware to add headers (like content-type) but it feels a bit heavy handed
i am attempting to convert some code like this
let builder = client
.post(&url)
.basic_auth(
username,
Some(password.unsecure()),
)
.header("X-API-Token", token)
.header("Content-type", "application/json");
to
#[derive(Builder, Debug, Clone, Endpoint)]
#[endpoint(path = "call/{self.name}/{self.number}/", method = "POST", builder = "true")]
#[builder(setter(into))]
struct Call {
pub name: String,
pub number: u32,
}
let endpoint = Call::builder()
.name(name)
.number(number)
.build()?;
let client = Client::default(&url_base);
...
But i don't see an easy way to add the basic_auth.
Am I missing something?
Thanks
Metadata
Metadata
Assignees
Labels
No labels