Closed gjorchard closed 9 years ago
Hmmm, how did that slip through my tests!?! Will look into this asap!
I have done several modifications, as well as fixed the described bug. Please give it another go and let me know how you proceed.
I tried my couple of applications and they work with the latest version. I am running with ParseBehavior set to Always and have tested with errors being returned.
I took a quick look at your change and was glad to see you have added the NotSupportedExceptions if there are problems with the ContentType header.
Good stuff!
I tried running the version you posted today. I did not work regardless of the setting of the new ParseBehavior. I looked into the HalClient code and found that it was not finding the "Content-Type" header. Looking at an HttpResponseMessage in Visual Studio I found it in the Content.Headers rather than Headers.
I change the line in ProcessResponseMessage from:
if (response.Headers.TryGetValues("Content-Type", out contentTypes))
to
if (response.Content.Headers.TryGetValues("Content-Type", out contentTypes))
and the code now appears to be working for me, though I haven't played with it much yet.
One suggestion for your updated documentation is to indicate what the default is for each of the settings.
Thanks for putting this new functionality in place!