PRI
The HTTP PRI method is the method name inside the HTTP/2 connection preface. The preface starts with a fixed 24-byte string sent as the first bytes of every HTTP/2 connection as a final confirmation of the protocol in use.
Usage
Every HTTP/2 connection begins with the
client connection preface: a fixed 24-byte string
followed by a mandatory SETTINGS frame. The string
is the ASCII sequence
PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n, which
resembles an HTTP/1.1 request line using the
method name "PRI", the request-target *, and the
version string "HTTP/2.0".
The format is deliberate. An HTTP/1.1 server receiving this string interprets "PRI" as an unrecognized method and responds with an error, typically 501 Not Implemented or 405 Method Not Allowed. This prevents legacy servers from misinterpreting HTTP/2 binary frames as malformed HTTP/1.1 traffic. The design ensures a clean failure when an HTTP/2 client accidentally connects to a server or intermediary limited to HTTP/1.1.
After the 24-byte string, the client immediately sends the SETTINGS frame completing the preface. To avoid unnecessary latency, the client is permitted to send additional frames right away without waiting for the server's SETTINGS frame in return. The server also sends its own connection preface (a SETTINGS frame) upon detecting HTTP/2.
Properties
| Property | Value |
|---|---|
| Safe | Yes |
| Idempotent | Yes |
| Cacheable | No |
Note
PRI is not a method in the traditional sense. No client sends a PRI request and no server processes one. The IANA registration reserves the name so no future method conflicts with the HTTP/2 connection preface. The 24-byte string is a protocol-level mechanism handled automatically by HTTP/2 implementations during connection setup. HTTP/3 uses an entirely different connection mechanism based on QUIC and does not use PRI.
Example
The raw bytes a client sends at the start of an HTTP/2 connection. The string is always identical, with no variation between implementations. Only clients send this preface.
PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n
Expressed as a hex dump, the 24 bytes are:
50 52 49 20 2a 20 48 54 54 50 2f 32 2e 30 0d 0a
0d 0a 53 4d 0d 0a 0d 0a
When an HTTP/1.1 server receives this preface, the response typically indicates an unsupported method. The exact status code varies by server implementation.
Typical response from an HTTP/1.1 server
HTTP/1.1 501 Not Implemented
Content-Length: 0
Connection: close
The server closes the connection after rejecting the unknown method. The HTTP/2 client detects the failure and falls back or reports an error, depending on the implementation.