-
Notifications
You must be signed in to change notification settings - Fork 81
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
doc: Add note on how to use builder style in build.rs and how to injec… #1100
base: main
Are you sure you want to change the base?
Conversation
…t default headers into the client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome and very much appreciated. One question and two suggestions for you. Thank you for the contribution!
|
||
## Changing default client settings | ||
|
||
Currently, the generated code doesn't deal with request headers. To add default headers to all requests, you can use the default_headers method when constructing the Client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it not? This is useful regardless, but I thought we accepted header parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any header autocomplete options pop up when using the Builder Interfacestyle generated api.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we talking about parameters to operations that are "in": "header"
? Or are you talking about the ability to set headers on specific requests e.g. client.foo().set_header("bar", "baz").send().await
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to seat a bearer token for each request.
README.md
Outdated
```rust | ||
let baseurl = "https://company.com/api/v2"; | ||
|
||
let access_token = "OP7nhQY46jf3I2sqyTZBHWEOIRsldfWEFlkjRkrjlER"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to have an example that reads an environment variable to encourage people not to accidentally leak credentials?
Co-authored-by: Adam Leventhal <adam.leventhal@gmail.com>
Co-authored-by: Adam Leventhal <adam.leventhal@gmail.com>
Add note on how to use builder style in build.rs and how to inject default headers into the client