Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Http2 protocol and status messages

So i just found out the hard way that the http2 protocol does not support http status messages like 404 Not Found in the old http1.1 protocol. One of our web Api's is using the http status message to return a readable message to the end user.

Now my question is, is there a new way of returning status messages in http2 or do we have to return the message in the http response body?

like image 372
Krika Avatar asked Apr 12 '16 08:04

Krika


People also ask

How do I check if a response is HTTP2?

Google Chrome offers a quick and easy way to check if HTTP/2 is supported on your SSL-enabled site. First, visit your site in Chrome over HTTPS. There you'll see your site listed with protocol h2, confirming your site works over HTTP/2.

What are the main goals and features of HTTP2?

The primary goals for HTTP/2 are to reduce latency by enabling full request and response multiplexing, minimize protocol overhead via efficient compression of HTTP header fields, and add support for request prioritization and server push.

What are the new features of HTTP2?

Some key features of HTTP/2 include: Binary: Meaning commands use 1s and 0s and not text. Multiplex: Permits multiple requests and responses to be sent at the same time. Compression: Compresses headers that have been requested previously to make things more efficient.


1 Answers

There is no new standard way, thus either a custom response header or the message body are your only choices.

(For the record: I argued against this change)

like image 116
Julian Reschke Avatar answered Sep 17 '22 13:09

Julian Reschke