HTTP-StreamParser

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

{
   "abstract" : "streaming HTTP parser",
   "author" : [
      "Tom Molesworth <cpan@entitymodel.com>"
   ],
   "dynamic_config" : 0,
   "generated_by" : "Dist::Zilla version 5.001, CPAN::Meta::Converter version 2.132830",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",

META.yml  view on Meta::CPAN

---
abstract: 'streaming HTTP parser'
author:
  - 'Tom Molesworth <cpan@entitymodel.com>'
build_requires:
  File::Spec: 0
  IO::Handle: 0
  IPC::Open3: 0
  Test::More: 0.98
  perl: 5.010001
configure_requires:
  ExtUtils::MakeMaker: 6.48

Makefile.PL  view on Meta::CPAN

use strict;
use warnings;

use 5.010001;

use ExtUtils::MakeMaker 6.48;



my %WriteMakefileArgs = (
  "ABSTRACT" => "streaming HTTP parser",
  "AUTHOR" => "Tom Molesworth <cpan\@entitymodel.com>",
  "BUILD_REQUIRES" => {},
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => "6.48"
  },
  "DISTNAME" => "HTTP-StreamParser",
  "EXE_FILES" => [],
  "LICENSE" => "perl",
  "NAME" => "HTTP::StreamParser",
  "PREREQ_PM" => {

README  view on Meta::CPAN



This archive contains the distribution HTTP-StreamParser,
version 0.101:

  streaming HTTP parser

This software is copyright (c) 2013 by Tom Molesworth.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.


lib/HTTP/StreamParser.pm  view on Meta::CPAN

package HTTP::StreamParser;
# ABSTRACT: streaming HTTP parser
use strict;
use warnings;
use parent qw(Mixin::Event::Dispatch);

our $VERSION = '0.101';

=head1 NAME

HTTP::StreamParser - support for streaming HTTP request/response parsing

=head1 VERSION

version 0.101

=head1 SYNOPSIS

 # For requests...
 my $req_parser = HTTP::StreamParser::Request->new;
 $req_parser->subscribe_to_event(

lib/HTTP/StreamParser.pm  view on Meta::CPAN

   http_code   => sub { print "Code:   $_[1]\n" },
   http_status => sub { print "Status: $_[1]\n" },
   http_header => sub { print "Header: $_[1]: $_[2]\n" },
 );
 $resp_parser->parse(<<'EOF');
 ...
 EOF

=head1 DESCRIPTION

Parses HTTP requests or responses. Generates events. Should be suitable for streaming.
You may be looking for L<HTTP::Parser::XS> instead - it's at least 20x faster than
this module. If you wanted something without XS, there's L<HTTP::Parser>.

Actual implementation is in L<HTTP::StreamParser::Request> or L<HTTP::StreamParser::Response>.

Typically you'd instantiate one of these for each request you want to parse. You'd then
subscribe to the events you're interested in - for example, header information, request method,
etc. - and then start parsing via L</parse>.

=cut

lib/HTTP/StreamParser.pm  view on Meta::CPAN


=head1 SEE ALSO

=over 4

=item * L<HTTP::Parser::XS> - used by several other modules, fast implementation, pure-Perl fallback,
but doesn't give access to the data until the headers have been parsed and aside from header count and
per-header size limitation, seems not to have any way to deal with oversized requests

=item * L<HTTP::Parser> - parses into L<HTTP::Request>/L<HTTP::Response> objects. Doesn't seem to guard
against large buffers but does have at least some support for streaming.

=item * L<HTTP::MessageParser> - also parses HTTP content

=item * L<Mojo::Message::Request> - part of L<Mojolicious>

=item * L<Mojo::Message::Response> - part of L<Mojolicious>

=item * L<HTTP::Response::Parser> - parses responses...

=item * L<POE::Filter::HTTP::Parser> - seems to be backed by L<HTTP::Parser::XS> / L<HTTP::Parser>

lib/HTTP/StreamParser/Request.pm  view on Meta::CPAN

package HTTP::StreamParser::Request;
{
  $HTTP::StreamParser::Request::VERSION = '0.101';
}
use strict;
use warnings;
use parent qw(HTTP::StreamParser);

=head1 NAME

HTTP::StreamParser::Request - streaming parser for HTTP response data

=head1 VERSION

version 0.101

=head1 SYNOPSIS

=head1 DESCRIPTION

=cut

lib/HTTP/StreamParser/Response.pm  view on Meta::CPAN

package HTTP::StreamParser::Response;
{
  $HTTP::StreamParser::Response::VERSION = '0.101';
}
use strict;
use warnings;
use parent qw(HTTP::StreamParser);

=head1 NAME

HTTP::StreamParser::Response - streaming parser for HTTP response data

=head1 VERSION

version 0.101

=head1 SYNOPSIS

=head1 DESCRIPTION




( run in 0.278 second using v1.01-cache-2.11-cpan-4d50c553e7e )