Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unable to remove default headers with method remove_header #263
When trying to replace the headers, set them empty or to remove the default methods and add new ones, the method remove_header has no impact on (at least) a request message type.
For example client::request<<remove_header("Content-Type") and client::request<<remove_header("Accept") used for removing default headers has no effect in removing the mentioned headers. Adding a header aftwerwards will add it additionally, hence the desired action, replacing the default headers with custom ones might not happen.
So technically there's a way around this where you set the Content-Type and/or Accept headers to be empty (or whatever value you want). If you do this and the defaults still clobber what you've set, then I can fix that bug.
What I intend to do though is to allow users to set Accept/Content-Type and other defaulted headers to be empty, in which case they will be removed. I know this is not intuitive but until the rewrite is complete, there's no easy way to set these defaults from the client options (where they should really be set).
Can you comment on whether setting the headers explicitly don't get clobbered anyway?