Skip to content

Invoke-WebRequest does not support -TransferEncoding deflate #1753

@SteveL-MSFT

Description

@SteveL-MSFT
PS D:> Invoke-WebRequest http://httpbin.org/deflate
Invoke-WebRequest : Block length does not match with its complement.
At line:1 char:1
- Invoke-WebRequest http://httpbin.org/deflate
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  - CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], InvalidDataException
  - FullyQualifiedErrorId : System.IO.InvalidDataException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Expected:
{
  "deflated": true, 
  "headers": {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,_/_;q=0.8", 
    "Accept-Encoding": "gzip, deflate, sdch", 
    "Accept-Language": "en-US,en;q=0.8", 
    "Cookie": "_ga=GA1.2.1281286921.1466206728", 
    "Host": "httpbin.org", 
    "Referer": "http://httpbin.org/", 
    "Upgrade-Insecure-Requests": "1", 
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
  }, 
  "method": "GET", 
  "origin": "131.107.159.201"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-DuplicateThe issue is a duplicate.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issues

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions