Skip to main content

1. Introduction

This document defines a simple format for representing an HTTP message [HTTP], either request or response. This allows for the encoding of HTTP messages that can be conveyed outside an HTTP protocol. This enables the transformation of entire messages, including the application of authenticated encryption.

The design of this format is informed by the framing structure of HTTP/2 [HTTP/2] and HTTP/3 [HTTP/3]. Rules for constructing messages rely on the rules defined in HTTP/2, but the format itself is distinct; see Section 6.

This format defines "message/bhttp", a binary alternative to the "message/http" content type defined in [HTTP/1.1]. A binary format permits more efficient encoding and processing of messages. A binary format also reduces exposure to security problems related to processing of HTTP messages.

Two modes for encoding are described:

  • a known-length encoding includes length prefixes for all major message components, and
  • an indeterminate-length encoding enables efficient generation of messages where lengths are not known when encoding starts.

This format is designed to convey the semantics of valid HTTP messages as simply and efficiently as possible. It is not designed to capture all of the details of the encoding of messages from specific HTTP versions [HTTP/1.1] [HTTP/2] [HTTP/3]. As such, this format is unlikely to be suitable for applications that depend on an exact recording of the encoding of messages.