Why is it said that HTTP2 is a binary protocol?

后端 未结 4 658
醉话见心
醉话见心 2020-12-31 17:39

I\'ve just read a article about differences between http1 and http2, but the main question that I have is when it says that http2 i

4条回答
  •  长情又很酷
    2020-12-31 18:22

    HTTP basically encodes all relevant instructions as ASCII code points, e.g.:

    GET /foo HTTP/1.1
    

    Yes, this is represented as bytes on the actual transport layer, but the commands are based on ASCII bytes, and are hence readable as text.

    HTTP/2 uses actual binary commands, i.e. individual bits and bytes which have no representation other than the bits and bytes that they are, and hence have no readable representation. (Note that HTTP/2 essentially wraps HTTP/1 in such a binary protocol, there's still "GET /foo" to be found somewhere in there.)

提交回复
热议问题