1HTTP::Message::PSGI(3)User Contributed Perl DocumentationHTTP::Message::PSGI(3)
2
3
4

NAME

6       HTTP::Message::PSGI - Converts HTTP::Request and HTTP::Response from/to
7       PSGI env and response
8

SYNOPSIS

10         use HTTP::Message::PSGI;
11
12         # $req is HTTP::Request, $res is HTTP::Response
13         my $env = req_to_psgi($req);
14         my $res = res_from_psgi([ $status, $headers, $body ]);
15
16         # Adds methods to HTTP::Request/Response class as well
17         my $env = $req->to_psgi;
18         my $res = HTTP::Response->from_psgi([ $status, $headers, $body ]);
19

DESCRIPTION

21       HTTP::Message::PSGI gives you convenient methods convert HTTP::Request
22       object to PSGI env hash and convert PSGI response array ref to
23       HTTP::Response object.
24
25       If you want the other way round, see Plack::Request and
26       Plack::Response.
27

METHODS

29       req_to_psgi
30             my $env = req_to_psgi($req [, $key => $val ... ]);
31
32           Converts HTTP::Request object into PSGI env hash reference.
33
34       HTTP::Request::to_psgi
35             my $env = $req->to_psgi;
36
37           Same as "req_to_psgi" but an instance method in HTTP::Request.
38
39       res_from_psgi
40             my $res = res_from_psgi([ $status, $headers, $body ]);
41
42           Creates HTTP::Response object from PSGI response array ref.
43
44       HTTP::Response->from_psgi
45             my $res = HTTP::Response->from_psgi([ $status, $headers, $body ]);
46
47           Same as "res_from_psgi" but a class method in HTTP::Response.
48

AUTHOR

50       Tatsuhiko Miyagawa
51

SEE ALSO

53       HTTP::Request::AsCGI HTTP::Message Plack::Test
54
55
56
57perl v5.12.3                      2011-06-22            HTTP::Message::PSGI(3)
Impressum