Hi all
I have a small IIS service that has several GET methods and some (in progress) PUT/POST methods.
All my requests have Accept-Encoding: gzip on the header, as pb documentation recommends. This works great on GET methods, however, when I use PUT/POST methods, the response body is not readable.
My WCF POST method has the following attributes:
ResponseFormat = WebMessageFormat.Json
BodyStyle = WebMessageBodyStyle.Bare
When I use HttpClient against IIS/8.5, the response is unreadable. The response headers are the following:
HTTP/1.1 200 OK
Cache-Control: private
Date: Wed, 03 Jun 2020 13:50:55 GMT
Content-Length: 124
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Server: Microsoft-IIS/8.5
Vary: Accept-Encoding
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
When I use my local IIS express, the response is readble. The response headers are the following:
HTTP/1.1 200 OK
Cache-Control: private
Date: Wed, 03 Jun 2020 13:58:48 GMT
Content-Length: 2
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcbWljaGVsb3Ncc291cmNlXHJlcG9zXEVycFdlYlNydlxMb2dpc21vc0VycFdTXEVycFNydi5zdmNcZW1wXERpc2NvdW50c1xQYXJhbVdpblxDYXRhbG9n?=
X-Powered-By: ASP.NET
If I disable gzip compression, both requests return readable results.
Should I consider this a PB bug or it's expected behavior?
Do you recommend any workaround, except disabling gzip compression?
thanks!
But now I am worried, how the GET methods worked?
Maybe the server did not returned compressed data?
I will come back if I find anything suspicious...!
You can compare the two response headers you provided.
The response headers from your local IIS express doesn't include the "Content-Encoding: gzip" info.
So maybe the package returned by the Web service is not a compressed one.
Nothing wrong with PB, my IIS needs some digging....