Closed daronspence closed 3 years ago
While I do admit that's a little unfortunate it's not meant that you chain the asX
methods like that. You'd want to indicate a Http request as one or the other, not toggle between those states. In that case it's probably best that you initiate a new Http call instance all together.
However, if you could somehow send in a PR that fixes this in a clean way than we could consider that. Thanks
Description:
When calling multiple methods on the HTTP facade that manipulate similar headers for the request, the
Content-Type
header is not overwritten with the most recent value.Steps To Reproduce:
If you inspect the object of this chain, you will see what I'm talking about.
In this scenario, I would expect the
Content-Type
to be equal to the last set value for that header;application/json
in this case.I know this example is a little contrived, but in my app, I had an Http client configuration that I wanted to override to a different Content-Type for one request. I expected to be able to call the appropriate method to change the content type but it didn't work.
As a workaround I created a macro to clear the content type header.
Is this expected behavior?
Thanks!