I am calling into an API endpoint with Invoke-WebRequest and the response headers are:
content-encoding: br content-type: text/html; charset=UTF-8
What do I need to do for the invoke-webrequest response to not look like this:
����%�ƫ�:��u�-P���xE���Y3
Are there certain flags I need to pass in for the invoke-webrequest?
EDIT:
Code:
Invoke-WebRequest -UseBasicParsing -Uri "https://ApiEndpoint.com/x" `
-WebSession $session `
-Headers @{
"method"="GET"
"authority"="redacted"
"scheme"="https"
"path"="/x"
"pragma"="no-cache"
"cache-control"="no-cache"
"sec-ch-ua"="`" Not;A Brand`";v=`"99`", `"Google Chrome`";v=`"97`",
`"Chromium`";v=`"97`""
"sec-ch-ua-mobile"="?0"
"sec-ch-ua-platform"="`"Windows`""
"upgrade-insecure-requests"="1" "accept"="text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
"sec-fetch-site"="same-origin"
"sec-fetch-mode"="navigate"
"sec-fetch-user"="?1"
"sec-fetch-dest"="document"
"referer"="redacted"
"accept-encoding"="gzip, deflate, br"
"accept-language"="en-US,en;q=0.9"
}