File: README

package info (click to toggle)
libhttp-parser-perl 0.06-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 76 kB
  • sloc: perl: 168; makefile: 2
file content (58 lines) | stat: -rw-r--r-- 1,193 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
HTTP/Parser
===========

HTTP::Parser is a stateful HTTP request/response parsing module.

It accepts chunks of data passed to it and returns either a completion hint
or an HTTP::Request (or Response) object when it has the entire request.  It
was originally written to be part of a simple Event.pm-based HTTP server.

e.g.

 use HTTP::Parser;

 my $parser = HTTP::Parser->new();
 my @lines = ('GET / HTTP/1.1','Host: localhost','Connection: close','','');

 my $result;
 foreach my $line (@lines) {
   $result = $parser->add("$line\x0d\x0a");
   print "passing '$line' got '$result'\n";
 }
 print $parser->object->as_string();


gives:

 GET /
 Connection: close
 Host: localhost
 X-HTTP-Version: 1.1

INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install

DEPENDENCIES

This module requires these other modules and libraries:

  perl 5.6.1

  HTTP::Request
  HTTP::Response (both part of libwww-perl)
  URI

COPYRIGHT AND LICENCE

Copyright (C) 2004-2007 David B. Robins
Some fixes for 0.05 supplied by David Cannings

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