Use Http/2 to make api calls from javascript
<p>I know most browsers support http/2 for loading the pages but does this mean I can leverage it when I make api calls using XmlHttpRequest ?</p>

<p>More specifically my question is if I make 2 calls to fetch data using XmlHttpRequest does it ensure that both of them use the same tcp connection underneath ? None of the documentation I read any where specifies any thing about http2 support for XmlHttpRequest or how I can explicitly open a http2 connection, make some calls leveraging this and then close the connection.</p>

<p>The okHttp, jetty and other libraries in java offer client libraries to support this. But the javascript support is not clear.</p>