POE::Filter::HTTPD

POE::Filter::HTTPD is a Perl module to convert stream to HTTP::Request; HTTP::Response to stream.
Download

POE::Filter::HTTPD Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Artur Bergman
  • Publisher web site:
  • http://search.cpan.org/~rcaputo/POE-1.0003/lib/POE/Filter/HTTPD.pm

POE::Filter::HTTPD Tags


POE::Filter::HTTPD Description

POE::Filter::HTTPD is a Perl module to convert stream to HTTP::Request; HTTP::Response to stream. POE::Filter::HTTPD is a Perl module to convert stream to HTTP::Request; HTTP::Response to stream.SYNOPSIS $httpd = POE::Filter::HTTPD->new(); $arrayref_with_http_response_as_string = $httpd->put($full_http_response_object); $arrayref_with_http_request_object = $line->get($arrayref_of_raw_data_chunks_from_driver);The HTTPD filter parses the first HTTP 1.0 request from an incoming stream into an HTTP::Request object (if the request is good) or an HTTP::Response object (if the request was malformed). To send a response, give its put() method a HTTP::Response object.Here is a sample input handler: sub got_request { my ($heap, $request) = @_; # The Filter::HTTPD generated a response instead of a request. # There must have been some kind of error. You could also check # (ref($request) eq 'HTTP::Response'). if ($request->isa('HTTP::Response')) { $heap->{wheel}->put($request); return; } # Process the request here. my $response = HTTP::Response->new(200); $response->push_header( 'Content-Type', 'text/html' ); $response->content( $request->as_string() ); $heap->{wheel}->put($response); }Please see the documentation for HTTP::Request and HTTP::Response.POE::Filter::HTTPD is a Perl module to convert stream to HTTP::Request; HTTP::Response to stream. Requirements: · Perl


POE::Filter::HTTPD Related Software