'Print HTTP protocol version of given url

I'm building a webapp using Vue CLI to analyze http responses. I'm using axios to make get requests and a chrome extension which allows to send cross-domain requests.

My goal is to print HTTP protocol version, as I can't find it in the axios response but I can see it using chrome dev tools.

Here how I handled the axios request:

axios({
    method: this.userMethod,
    url: url,
  })
    .then((r) => {
      this.response = r;
      };
    })
    .catch((e) => {
      console.error(e);
    });

Where 'url' is a URL object.

This is the kind of response I get from a site (StackOverflow in this example) once I activate the CORS extension.

What I want to get is the "h2" protocol version that chrome dev tools shows. My goal is to take that and print it on screen, but I can't find it in the axios response. I've read about 'curl' using the command line, Is that possible with Javascript too or am I completely off path?

A screenshot of the response headers



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source