Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protocol version from JavaScript Fetch responses

I was just playing with Fetch and noticed it seemed impossible to get the protocol version from the response start line. During an HTTP request the first line of a response could look like this:

HTTP/1.1 404 Not Found

Basically, I am looking for a way to get the HTTP/1.1 part of the first line.

I was able to find the Response.status and Response.statusText properties, but is there a way to get either the first line (which does not seem to be part of Response.headers) or the protocol version directly?

like image 796
Nicolas Bouvrette Avatar asked Feb 27 '26 23:02

Nicolas Bouvrette


1 Answers

The short answer is: No, it's not possible.

I could actually not find details on the "long answer" and why this information was unavailable.

like image 149
Nicolas Bouvrette Avatar answered Mar 01 '26 12:03

Nicolas Bouvrette