Note that browsers offer the decompression to you by default but the MSXML2.serverXMLHTTP COM/OLE component pre-dates the modern compression habits. It simply lacks the option to cope with that kind of responses.
If you inspect the responseHeader "Content-Encoding" after you called send
like so:
MsgBox xh.getResponseHeader("Content-Encoding")
MsgBox xh.getResponseHeader("Content-Encoding")
xh.setRequestHeader "Accept-Encoding", "deflate;q=1.0"
xh.setRequestHeader "Accept-Encoding", "deflate;q=1.0"
decompressedsize = size(3) * 2 ^ 32 + size(2) * 2 ^ 16 + size(1) * 2 ^ 8 + size(0)
decompressedsize = size(3) * 2 ^ 32 + size(2) * 2 ^ 16 + size(1) * 2 ^ 8 + size(0)
Dim xh As Object
Set xh = CreateObject("MSXML2.serverXMLHTTP")
seurl = "https://api.stackexchange.com/2.3/tags?order=desc&sort=popular&site=stackoverflow"
xh.Open "GET", seurl, False
xh.setRequestHeader "Accept-Encoding", "gzip;q=1.0"
xh.Send
MsgBox xh.getResponseHeader("Content-Encoding")
Dim httpresponse() As Byte
httpresponse = xh.responseBody
Mod_Inflate64.Inflate httpresponse
MsgBox StrConv(httpresponse, vbUnicode)
Dim xh As Object
Set xh = CreateObject("MSXML2.serverXMLHTTP")
seurl = "https://api.stackexchange.com/2.3/tags?order=desc&sort=popular&site=stackoverflow"
xh.Open "GET", seurl, False
xh.setRequestHeader "Accept-Encoding", "gzip;q=1.0"
xh.Send
MsgBox xh.getResponseHeader("Content-Encoding")
Dim httpresponse() As Byte
httpresponse = xh.responseBody
Mod_Inflate64.Inflate httpresponse
MsgBox StrConv(httpresponse, vbUnicode)