0

I'm having a problem and i'm not using HttpClient because i'm having a problem about invalid headers that can not be read after PostAsync() invoked.

My solution for that, was to implement the automation using TcpClient with SslStream. This way works well but when I get a response that I have to decompress de content returned, I'm not getting solve the decompression.

The content returned is : \u001f�\b\0\0\0\0\0\u0004\0�\a\u001cI�%&/m�{\u007fJ�J��t�\b�\u0013$ؐ@\u0010������\u001diG#)�*��eVe]f\u0016@�흼��{���{���;�N'���?\fd\u0001l��J�ɞ!���\u001f?~|\u001f?"����\a)�L\r\u0002\0\0\0\0\0\0\0\0\0\0

The httpResponse is:

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Expires: -1
Vary: Accept-Encoding
X-AspNet-Version: 4.0.30319
X-XSS-Protection: 1; mode=block
Content-Security-Policy: frame-ancestors 'self'
Strict-Transport-Security: max-age=15552001; preload
X-Permitted-Cross-Domain-Policies: none
Public-Key-Pins: pin-sha256="base64+primary==&quot
Set-Cookie HttpOnly: Secure
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Feature-Policy: vibrate 'self'
Date: Tue, 01 Aug 2023 19:51:37 GMT
Content-Length: 290

Can anyone help me with this???

I'm using .net 3.1 with c# too.

I think I tried of everything that was possible.

Which is funny because the response should be a json message result.

I tried use GzipStream, DeflateStream e BrotliStream to decompress the content but none of them works.

Take a look at the reponse headers:

Content-Encoding: gzip

It said that the content was compressed by gzip.

  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 12 '23 at 12:29

0 Answers0