Closed Qriist closed 5 months ago
Maybe curl sets some other request header.
In addition, WinHttp does not support gzip decoding, WinHttp.WinHttpRequest.5.1
supports.
Maybe curl sets some other request header.
No, it's setting what I asked it to
In addition, WinHttp does not support gzip decoding,
WinHttp.WinHttpRequest.5.1
supports.
Ohhh then should I use the WinHttpRequest library that you've made, instead? https://github.com/thqby/ahk2_lib/blob/master/WinHttpRequest.ahk
In winhttp, setRequestHeader("Accept-Encoding","gzip")
does not appear to take effect because gzip is not supported.
url := "https://titsandasses.org/"
web := ComObject('WinHttp.WinHttpRequest.5.1')
web.Open("GET",url)
web.SetRequestHeader("Accept","*/*")
web.SetRequestHeader("Accept-Encoding","gzip")
web.Send()
MsgBox web.getAllResponseHeaders()
Connection: Keep-Alive
Date: Mon, 12 Feb 2024 09:16:02 GMT
Keep-Alive: timeout=5, max=100
Content-Length: 121
Content-Type: text/html
Content-Encoding: gzip
Last-Modified: Mon, 25 Apr 2005 13:39:47 GMT
Accept-Ranges: bytes
ETag: "c4-3f592f0f8cec0-gzip"
Server: Apache/2.4.38 (Debian)
Vary: Accept-Encoding
I'm using thqby's Winhttp class with my pull request. (My changes shouldn't have any impact on this problem.)
I am trying to set an
Accept-Encoding
header but it's being... difficult. Not throwing any errors, and not failing, just not returning the expected headers/data.Code used:
ahk gives me:
There is no
Content-Encoding
response header.Meanwhile, using this command:
curl -v -s -o nul -H "Accept-Encoding: gzip" --output - https://titsandasses.org/
curl gives me:
Note the presence of the
Content-Encoding
header and the smallerContent-Length
value.Any ideas?