Gzip HttpWebRequest

I am sending HTTP POST requests through HttpWebRequest which contain a lot of content. I would like gzip message content. Is it possible?

Do I need to configure IIS 7 to handle compressed content? It is already configured to serve compressed responses.

I tried adding the Content-Encoding = gzip header and writing it to the request stream wrapped in GZipStream, but the server returns 504 (GatewayTimeout), which seems odd.

+3
source share
2 answers

- . mod_deflate Apache, ( - - DoS). IIS.

, , . , multipart/form-data, URL .

+1

, IIS7 GZIP, . . IIS7 gzip.dll .

c:\Windows\System32\inetsrv>c:\vc9\bin\dumpbin.exe  -exports gzip.dll
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file gzip.dll

File Type: DLL

  Section contains the following exports for gzip.dll

    00000000 characteristics
    47919400 time date stamp Sat Jan 19 01:09:04 2008
        0.00 version
           1 ordinal base
           6 number of functions
           6 number of names

    ordinal hint RVA      name

          1    0 0000242D Compress
          2    1 00002E13 CreateCompression
          3    2 000065AE DeInitCompression
          4    3 000012EE DestroyCompression
          5    4 0000658D InitCompression
          6    5 000065B6 ResetCompression

  Summary

        1000 .data
        1000 .reloc
        1000 .rsrc
        6000 .text

, gzip.dll. gzip.dll, 12 , 6, Decompression.

+4

Source: https://habr.com/ru/post/1728356/


All Articles