T
T
Toopie2018-09-10 21:46:01
Microsoft
Toopie, 2018-09-10 21:46:01

How to enable HTTP/2 support in XMLHTTPRequest?

Hello, I need to make the XMLHTTPRequest function enable http/2 support.
Here is the function itself (language - AutoHotKey):

ComObjError(false)
whr := ComObjCreate("Msxml2.XMLHTTP.6.0")
whr.Open("GET", "https://domain.me", true)
whr.Send()
MsgBox, % whr.readyState
MsgBox, % whr.ResponseText

5b96bb6e16339789946569.png
The response specifies the HTTP protocol version - 1.1 ("http_version":1.1)
We need to enable http/2 support somehow, but how?
Here is the answer if you open the site from a browser:
{"response":{"status":false,"code":102,"system":{"http_version":2,"time":1536605087}}}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2018-09-10
@RidgeA

Turn on - nothing.
First, the server must support HTTP/2. Second, the client implementation must support HTTP/2.
The beauty is that the correct implementation perfectly knows how to work both over HTTP / 2 and over earlier versions of the protocol. Because the HTTP protocol version is a lower level of abstraction, and for XMLHTTPRequest the protocol version does not matter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question