5. Examples
5.1. Request Example
A simple GET request:
GET /hello.txt HTTP/1.1
Host: www.example.com
Would be encoded as a known-length binary message with:
- Framing Indicator = 0 (known-length request)
- Method = "GET"
- Scheme = "https"
- Authority = "www.example.com"
- Path = "/hello.txt"
- Header section with "host" field
- Empty content (length = 0)
- Empty trailer section (length = 0)
5.2. Response Example
A simple 200 OK response:
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 12
Hello World!
Would be encoded with:
- Framing Indicator = 1 (known-length response)
- Status Code = 200
- Header section with "content-type" and "content-length" fields
- Content = "Hello World!" (12 bytes)
- Empty trailer section (length = 0)