Permalink
Browse files

rename *AGAIN*

  • Loading branch information...
1 parent eca7520 commit 9d7ae513841b4971889f5625b46e6a36d35fd5b3 @miyagawa committed Feb 25, 2010
View
@@ -1,4 +1,4 @@
-Revision history for Perl extension Piglet::Request
+Revision history for Perl extension HTTPx::Weblet::Request
0.09 Sun Dec 13 10:34:33 PST 2009
- Added $req->session accessor
View
@@ -22,35 +22,36 @@ inc/Test/Builder/Module.pm
inc/Test/Exception.pm
inc/Test/More.pm
inc/Test/Requires.pm
-lib/Plack/Request.pm
-lib/Plack/Request/BodyParser.pm
-lib/Plack/Request/Upload.pm
-lib/Plack/Response.pm
+lib/HTTPx/Weblet.pm
+lib/HTTPx/Weblet/Request.pm
+lib/HTTPx/Weblet/Request/BodyParser.pm
+lib/HTTPx/Weblet/Request/Upload.pm
+lib/HTTPx/Weblet/Response.pm
Makefile.PL
MANIFEST This list of files
META.yml
README
t/00_compile.t
-t/Plack-Request/body.t
-t/Plack-Request/content.t
-t/Plack-Request/cookie.t
-t/Plack-Request/double_port.t
-t/Plack-Request/hostname.t
-t/Plack-Request/many_upload.t
-t/Plack-Request/new.t
-t/Plack-Request/parameters.t
-t/Plack-Request/params.t
-t/Plack-Request/path_info.t
-t/Plack-Request/raw_body.t
-t/Plack-Request/raw_uri.t
-t/Plack-Request/readbody.t
-t/Plack-Request/upload-basename.t
-t/Plack-Request/upload.t
-t/Plack-Request/uri.t
-t/Plack-Response/body.t
-t/Plack-Response/new.t
-t/Plack-Response/redirect.t
-t/Plack-Response/response.t
+t/Request/body.t
+t/Request/content.t
+t/Request/cookie.t
+t/Request/double_port.t
+t/Request/hostname.t
+t/Request/many_upload.t
+t/Request/new.t
+t/Request/parameters.t
+t/Request/params.t
+t/Request/path_info.t
+t/Request/raw_body.t
+t/Request/raw_uri.t
+t/Request/readbody.t
+t/Request/upload-basename.t
+t/Request/upload.t
+t/Request/uri.t
+t/Response/body.t
+t/Response/new.t
+t/Response/redirect.t
+t/Response/response.t
t/Utils.pm
xt/perlcritic.t
xt/pod.t
View
@@ -1,7 +1,7 @@
use inc::Module::Install;
-name 'Plack-Request';
-all_from 'lib/Plack/Request.pm';
-readme_from 'lib/Plack/Request.pm';
+name 'HTTPx-Weblet';
+all_from 'lib/HTTPx/Weblet.pm';
+readme_from 'lib/HTTPx/Weblet.pm';
requires 'CGI::Simple::Cookie';
requires 'HTTP::Headers';
requires 'HTTP::Request';
View
168 README
@@ -1,169 +1,25 @@
NAME
- Piglet::Request - Portable HTTP request object from PSGI env hash
-
-SYNOPSIS
- use Piglet::Request;
-
- sub psgi_handler {
- my $env = shift;
- my $req = Piglet::Request->new($env);
- my $res = $req->new_response(200);
- $res->content_type('text/html');
- $res->body("Hello World");
- return $res->finalize;
- }
+ HTTPx::Weblet - HTTP::Engine-like request and response objects for PSGI
DESCRIPTION
- Piglet::Request provides a consistent API for request objects across web
- server environments.
-
-CAVEAT
- Note that this module is intended to be used by web application
- framework developers rather than application developers (end users).
- Writing your web application directly using Piglet::Request is certainly
- possible but not recommended: it's like doing so with mod_perl's
- Apache::Request: yet too low level.
-
- If you're writing a web application, not a framework, then you're
- encouraged to use one of the web application frameworks that support
- PSGI, or use HTTP::Engine if you want to write a micro web server
- application.
-
- Also, even if you're a framework developer, you probably want to handle
- Cookies and file uploads in your own way: Piglet::Request gives you a
- simple API to deal with these things but ultimately you probably want to
- implement those in your own code.
-
-METHODS
- new
- Piglet::Request->new( $psgi_env );
-
-ATTRIBUTES
- address
- Returns the IP address of the client.
-
- cookies
- Returns a reference to a hash containing the cookies
-
- method
- Contains the request method ("GET", "POST", "HEAD", etc).
-
- protocol
- Returns the protocol (HTTP/1.0 or HTTP/1.1) used for the current
- request.
-
- request_uri
- Returns the request uri (like $ENV{REQUEST_URI})
-
- query_parameters
- Returns a reference to a hash containing query string (GET)
- parameters. Values can be either a scalar or an arrayref containing
- scalars.
-
- secure
- Returns true or false, indicating whether the connection is secure
- (https).
-
- uri Returns a URI object for the current request. Stringifies to the URI
- text.
-
- user
- Returns REMOTE_USER.
-
- raw_body
- Returns string containing body(POST).
-
- headers
- Returns an HTTP::Headers object containing the headers for the
- current request.
-
- hostname
- Returns the hostname of the client.
-
- parameters
- Returns a reference to a hash containing GET and POST parameters.
- Values can be either a scalar or an arrayref containing scalars.
-
- uploads
- Returns a reference to a hash containing uploads. Values can be
- either a Piglet::Request::Upload object, or an arrayref of
- Piglet::Request::Upload objects.
-
- content_encoding
- Shortcut to $req->headers->content_encoding.
+ HTTPx::Weblet is a toolkit that contains HTTP::Engine-like Request and
+ Response for PSGI web applications. This is an *old* implementation of
+ how Plack::Request was written, based on HTTP::Engine::Request and
+ HTTP::Engine::Response.
- content_length
- Shortcut to $req->headers->content_length.
-
- content_type
- Shortcut to $req->headers->content_type.
-
- header
- Shortcut to $req->headers->header.
-
- referer
- Shortcut to $req->headers->referer.
-
- user_agent
- Shortcut to $req->headers->user_agent.
-
- cookie
- A convenient method to access $req->cookies.
-
- $cookie = $req->cookie('name');
- @cookies = $req->cookie;
-
- param
- Returns GET and POST parameters with a CGI.pm-compatible param
- method. This is an alternative method for accessing parameters in
- $req->parameters.
-
- $value = $req->param( 'foo' );
- @values = $req->param( 'foo' );
- @params = $req->param;
-
- Like CGI, and unlike earlier versions of Catalyst, passing multiple
- arguments to this method, like this:
-
- $req->param( 'foo', 'bar', 'gorch', 'quxx' );
-
- will set the parameter "foo" to the multiple values "bar", "gorch"
- and "quxx". Previously this would have added "bar" as another value
- to "foo" (creating it if it didn't exist before), and "quxx" as
- another value for "gorch".
-
- path
- Returns the path, i.e. the part of the URI after $req->base, for the
- current request.
-
- upload
- A convenient method to access $req->uploads.
-
- $upload = $req->upload('field');
- @uploads = $req->upload('field');
- @fields = $req->upload;
-
- for my $upload ( $req->upload('field') ) {
- print $upload->filename;
- }
-
- new_response
- my $res = $req->new_response;
-
- Creates a new Plack::Response by default. Handy to remove dependency
- on Plack::Response in your code for easy subclassing and duck typing
- in web application frameworks, as well as overriding Response
- generation in middlewares.
+ New middleware authors and web application framework authors are
+ recommended to take a look and upgrade to the latest Plack::Request.
AUTHORS
Kazuhiro Osawa
Tokuhiro Matsuno
-SEE ALSO
- Plack::Response HTTP::Request, Catalyst::Request
+ Tatsuhiko Miyagawa
LICENSE
- This library is free software; you can redistribute it and/or modify it
- under the same terms as Perl itself.
+ This software is licensed under the same terms as Perl.
+
+SEE ALSO
+ Plack::Request HTTP::Engine
View
@@ -0,0 +1,39 @@
+package HTTPx::Weblet;
+use strict;
+use 5.008001;
+our $VERSION = "0.1000";
+
+__END__
+
+=head1 NAME
+
+HTTPx::Weblet - HTTP::Engine-like request and response objects for PSGI
+
+=head1 DESCRIPTION
+
+HTTPx::Weblet is a toolkit that contains L<HTTP::Engine>-like Request
+and Response for PSGI web applications. This is an I<old>
+implementation of how L<Plack::Request> was written, based on
+L<HTTP::Engine::Request> and L<HTTP::Engine::Response>.
+
+New middleware authors and web application framework authors are
+recommended to take a look and upgrade to the latest L<Plack::Request>.
+
+=head1 AUTHORS
+
+Kazuhiro Osawa
+
+Tokuhiro Matsuno
+
+Tatsuhiko Miyagawa
+
+=head1 LICENSE
+
+This software is licensed under the same terms as Perl.
+
+=head1 SEE ALSO
+
+L<Plack::Request> L<HTTP::Engine>
+
+=cut
+
Oops, something went wrong.

0 comments on commit 9d7ae51

Please sign in to comment.