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
- fedora 43: perl-Plack 1.0055-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Plack 1.0055-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms