drogonframework / drogonframework/drogon
`addHeader` for `HttpClient`
- Dominant language
- C++
- Stars
- 14.3k
- Forks
- 1.4k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
**Is your feature request related to a problem? Please describe.**
Currently there's only an `addHeader` function on the `HttpRequest`. If you have a header that is needed for every request (for example "Authorization"), you'd need to add it before every request.
**Describe the solution you'd like**
I'd like to have that function on the `HttpClient` as well so that the header is sent for all requests using that client (just like `addCookie`).
The question then would be: What happens with headers that are added via the Request that are already present via the Client? Silently override? Exception?
Contributor guide
Research direction
Start by locating the HttpClient and HttpRequest classes and their existing addCookie and addHeader implementations. Trace how client requests are assembled, then define and test the behavior when the same header is set on both objects; done means a client-level header is sent with every request and the precedence is documented or enforced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100