NAME
Hypersonic::Protocol::HTTP1 - JIT code generation for HTTP/1.1 protocol
SYNOPSIS
use Hypersonic::Protocol::HTTP1;
# Build a complete response at compile time
my $response = Hypersonic::Protocol::HTTP1->build_response(
status => 200,
headers => { 'X-Custom' => 'value' },
body => '{"ok":true}',
);
# Generate C code for method parsing
Hypersonic::Protocol::HTTP1->gen_method_parser($builder, $analysis);
DESCRIPTION
This module provides JIT compile-time code generation for HTTP/1.1 protocol handling. All methods either return pre-built strings or generate C code using XS::JIT::Builder. There is zero runtime overhead.
HTTP/1.1 Specifics
Text-based request format:
GET /path HTTP/1.1\r\nCRLF delimiters:
\r\nbetween headers,\r\n\r\nbefore bodyKeep-alive: Default in HTTP/1.1, detected via
Connection: closeResponse format: Status line + headers + body
METHODS
build_response(%args)
Build a complete HTTP/1.1 response string at compile time.
gen_method_parser($builder, $analysis)
Generate C code for parsing HTTP method using XS::JIT::Builder.
gen_path_parser($builder)
Generate C code for parsing request path.
gen_body_parser($builder, %opts)
Generate C code for finding request body.
gen_keepalive_check($builder)
Generate C code for detecting Connection: close.
AUTHOR
Hypersonic Contributors