C
C#9mo ago
Toichkin

❔ HttpClient Request headers automatically capitalizing.

How do i stop my HttpClient Header Names from automatically capitalizing? tried TryAddWithoutValidation, still the header names are getting automatically capitalized.
14 Replies
Angius
Angius9mo ago
According to RFC 2616 header names are not case-sensitive So it doesn't matter
Toichkin
Toichkin9mo ago
in this case, for my purpose, it matters, any help would be appreciated
SWR
SWR9mo ago
Why does it matter?
Toichkin
Toichkin9mo ago
because the server only accepts it in lowercase
Angius
Angius9mo ago
The server does not follow the HTTP spec, then, and should be thrown into the trash where it belongs That's also the official answer to the issue: https://github.com/dotnet/runtime/issues/30819#issuecomment-538548816
SWR
SWR9mo ago
Who maintains the server?
Toichkin
Toichkin9mo ago
it's api of a big company (im not abusing it for harm)
SWR
SWR9mo ago
Bad company
Toichkin
Toichkin9mo ago
wouldn't say that if they are a bad company they wouldn't have 3.2 billion sales volume
SWR
SWR9mo ago
Ok. If you REALLY need to lowercase the headers, the best I can think of is make a man in the middle local tcp server. You intercept http messages and just lowercase the headers Sadly, that totally screws your network. Is this for work or school? You could also fork libhttpserver and lowercase the headers
Toichkin
Toichkin9mo ago
i was thinking of using restsharp, but i don't know if that would fix it
SWR
SWR9mo ago
catshrug is this big company server anyway?
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
Accord
Accord9mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.