Relative Content

Tag Archive for c#.net.net-coredotnet-httpclient

Has something changed with HttpClientHandler in .net 8 vs 4.5?

I have been tasked with upgrading some old apis to .net 8 from .net 4.5 as we are looking to move our apis to azure (and want them to be platform agnostic). In my 4.5 solution for one API I have code that calls a third party API, passing in a cookie and some headers and gets back some data. This works fine. The same code put into a .net 8 library (and part of a new API) returns a bad request and I confirmed with the 3rd party that this is because the value in the cookie and one of the headers do not match even though they should/do as they are the same guid value that we generate on the fly. below is the code and it’s been driving me nuts as I can see no reason this should not work.