HTTP::M...ge::PSGI(3)

πŸ’– HTTP::M...ge::PSGI πŸ’–

okay bestie, so this is HTTP::Message::PSGI(3) β€” a User Contributed Perl Documentation page, and honestly? it's giving little utility icon. it takes your HTTP::Request and HTTP::Response objects and flips them into PSGI env / response stuff, and back again. no cap. πŸ¦‹


✨ NAME ✨

HTTP::Message::PSGI β€” converts HTTP::Request and HTTP::Response from/to PSGI env and response πŸŽ€


🌸 SYNOPSIS 🌸

use HTTP::Message::PSGI;

# $req is HTTP::Request, $res is HTTP::Response
my $env = req_to_psgi($req);
my $res = res_from_psgi([ $status, $headers, $body ]);

# Adds methods to HTTP::Request/Response class as well
my $env = $req->to_psgi;
my $res = HTTP::Response->from_psgi([ $status, $headers, $body ]);

πŸ‘‘ DESCRIPTION πŸ‘‘

so HTTP::Message::PSGI hands you the convenient methods to convert an HTTP::Request object into a PSGI env hash, and to convert a PSGI response arrayref into an HTTP::Response object. literally that simple, that's the whole job. slay. πŸ’…

now if you want it the other way around? different page, bestie β€” go see Plack::Request and Plack::Response. 🧚


πŸ”₯ METHODS πŸ”₯

req_to_psgi

my $env = req_to_psgi($req [, $key => $val ... ]);

takes an HTTP::Request object and turns it into a PSGI env hash reference. boom. ✨

HTTP::Request::to_psgi

my $env = $req->to_psgi;

same energy as req_to_psgi, except it's an instance method living on HTTP::Request. main character behavior. πŸ’œ

res_from_psgi

my $res = res_from_psgi([ $status, $headers, $body ]);

creates an HTTP::Response object out of a PSGI response array ref. yeah. out of an arrayref. iconic. 🌈

HTTP::Response->from_psgi

my $res = HTTP::Response->from_psgi([ $status, $headers, $body ]);

same as res_from_psgi, but it's a class method up in HTTP::Response. periodt. ⭐


🫢 AUTHOR 🫢

Tatsuhiko Miyagawa πŸ‘‘


πŸ’€ SEE ALSO πŸ’€

HTTP::Request::AsCGI Β· HTTP::Message Β· Plack::Test

ngl these are your supplementary materials, go read them if you're feeling studious πŸ“

okay that's the whole thing, you're welcome πŸ’– this was HTTP::M...ge::PSGI(3), perl v5.42.3, dated 2026-10-18 β€” no notes, she ate, hope this helped bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from