view release on metacpan or search on metacpan
"Catalyst::View" : "0",
"Catalyst::View::TT" : "0",
"File::Find" : "0",
"File::Temp" : "0",
"FindBin" : "0",
"HTTP::Request::AsCGI" : "0",
"Test::More" : "0.96",
"Text::Diff" : "0",
"base" : "0",
"lib" : "0"
}
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Catalyst-Action-RenderView
0.17 2024-10-12
- fix Makefile.PL to work without PERL_USE_UNSAFE_INC
- revised packaging to use Dist::Zilla
- drop unused prereq HTTP::Request::AsCGI
0.16 2011-01-05 19:28:00 GMT
- Fix bug accidentally introduced in the last version with response
3xx statuses.
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/Test/Rest.pm view on Meta::CPAN
{
url => { type => SCALAR },
headers => { type => HASHREF, default => {} },
},
);
my $req = HTTP::Request->new( "$method" => $p{'url'} );
$req->header( $_ => $p{headers}{$_} ) for keys %{ $p{headers} };
$req->content_type( $self->{'content_type'} );
return $req;
};
}
t/lib/Test/Rest.pm view on Meta::CPAN
url => { type => SCALAR },
data => 1,
headers => { type => HASHREF, default => {} },
},
);
my $req = HTTP::Request->new( "$method" => $p{'url'} );
$req->header( $_ => $p{headers}{$_} ) for keys %{ $p{headers} };
$req->content_type( $self->{'content_type'} );
$req->content_length(
do { use bytes; length( $p{'data'} ) }
);
view all matches for this distribution
view release on metacpan or search on metacpan
use strict;
use warnings FATAL => 'all';
use Test::More 0.89;
use HTTP::Request::Common qw/GET POST DELETE/;
use FindBin;
use lib "$FindBin::Bin/lib";
use TestApp;
view all matches for this distribution
view release on metacpan or search on metacpan
"Catalyst::Runtime" : "5.90013",
"Catalyst::ScriptRunner" : "0",
"Catalyst::Test" : "0",
"Data::Printer" : "0",
"FindBin::libs" : "0",
"HTTP::Request" : "0",
"JSON" : "0",
"JSON::XS" : "0",
"Net::Stomp" : "0",
"Test::Most" : "0",
"bytes" : "0"
view all matches for this distribution
view release on metacpan or search on metacpan
build_requires:
Catalyst: 0
Catalyst::Controller::ActionRole: 0
Catalyst::Test: 0
ExtUtils::MakeMaker: 6.59
HTTP::Request::Common: 0
Moose: 0
Test::More: '0.96'
configure_requires:
ExtUtils::MakeMaker: 6.59
distribution_type: module
view all matches for this distribution
view release on metacpan or search on metacpan
],
"build_requires" : {
"Catalyst::Controller::ActionRole" : "0",
"Catalyst::Test" : "0",
"FindBin" : "0",
"HTTP::Request::Common" : "0",
"Moose" : "1.03",
"Test::More" : "0.89"
},
"configure_requires" : {
"ExtUtils::MakeMaker" : "6.31"
view all matches for this distribution
view release on metacpan or search on metacpan
Release history for Catalyst-ActionRole-Methods
0.104 - 2024-03-21
- Support for HTTP::Request::Common < 6.21
0.103 - 2024-02-25
- Correct content type for the default 405 response
- Minor code cleanups and speedups
- Improved documentation
view all matches for this distribution
view release on metacpan or search on metacpan
MyApp->setup;
}
use Catalyst::Test 'MyApp';
use HTTP::Request::Common;
{
ok my $res = request(GET '/22?foo=44&bar=55&bar=66&baz=77');
}
view all matches for this distribution
view release on metacpan or search on metacpan
abstract: 'Constraints for your Query parameters'
author:
- 'John Napiorkowski <jjnapiork@cpan.org>'
build_requires:
Catalyst: '5.90103'
HTTP::Request::Common: '0'
Test::Most: '0'
Type::Tiny: '1.000005'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
view all matches for this distribution
view release on metacpan or search on metacpan
t/02_render.t view on Meta::CPAN
use FindBin qw($Bin);
use lib "$Bin/lib";
use Test::More;
use Catalyst::Test 'TestApp';
use HTTP::Request::Common;
use_ok('Catalyst::Test', 'TestApp');
# render TT
{
ok my $res = request GET '/render_tt';
view all matches for this distribution
view release on metacpan or search on metacpan
use FindBin;
use lib "$FindBin::Bin/lib";
use Test::More tests => 29;
use Catalyst::Test 'TestApp';
use HTTP::Request::Common;
ok( my $res = request('https://localhost/root_ssl'), 'request ok' );
is( $res->code, 200, 'SSL request to SSL' );
my $ctx;
view all matches for this distribution
view release on metacpan or search on metacpan
Catalyst::Plugin::Session::State::Cookie: 0
Catalyst::Plugin::Session::Store::Dummy: 0
Catalyst::Plugin::Static::Simple: 0
ExtUtils::MakeMaker: 6.59
HTTP::Cookies: 0
HTTP::Request::AsCGI: 0
Test::More: 0
configure_requires:
ExtUtils::MakeMaker: 6.59
distribution_type: module
dynamic_config: 1
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Authentication/Credential/Crowd.pm view on Meta::CPAN
use warnings;
our $VERSION = '0.07';
use Moose;
use HTTP::Request;
use LWP::UserAgent;
use JSON;
has 'authen_url' => (
is => 'ro',
lib/Catalyst/Authentication/Credential/Crowd.pm view on Meta::CPAN
my ( $self, $username, $password ) = @_;
my $ua = LWP::UserAgent->new;
my $uri = $self->authen_url."?username=$username";
my $json_hash = { value => $password };
my $json = to_json( $json_hash );
my $req = HTTP::Request->new( 'POST', $uri );
$req->authorization_basic(
$self->app->{app_name},
$self->app->{password}
);
$req->header('Accept' => 'application/json');
view all matches for this distribution
view release on metacpan or search on metacpan
t/live_app.t view on Meta::CPAN
eval { require Test::WWW::Mechanize::Catalyst }
or plan skip_all =>
"Test::WWW::Mechanize::Catalyst is needed for this test";
plan tests => 9;
}
use HTTP::Request;
{
package AuthTestApp;
use Catalyst qw/
Authentication
/;
t/live_app.t view on Meta::CPAN
is( $mech->status, 401, "status is 401" ) or die $mech->content;
$mech->content_lacks( "foo", "no output" );
}
{# HTTP with auth
my $r = HTTP::Request->new( GET => "http://localhost/moose" );
$r->authorization_basic(qw/foo s3cr3t/);
# $mech->request($r);
is( $mech->status, 200, "status is 200" );
$mech->content_contains( "test realm:foo", "test realm:foo output" );
}
{ # HTTP with other auth
my $r = HTTP::Request->new( GET => "http://localhost/moose" );
$r->authorization_basic(qw/foo proxypass/);
# $mech->request($r);
is( $mech->status, 401, "status is 401" ) or die $mech->content;
}
}
t/live_app.t view on Meta::CPAN
is( $mech->status, 401, "status is 401" ) or die $mech->content;
$mech->content_lacks( "foo", "no output" );
}
{ # Proxy with other auth
my $r = HTTP::Request->new( GET => "http://localhost/yak" );
$r->authorization_basic(qw/foo s3cr3t/);
# $mech->request($r);
is( $mech->status, 401, "status is 401" ) or die $mech->content;
}
{ # HTTP with other auth
my $r = HTTP::Request->new( GET => "http://localhost/yak" );
$r->authorization_basic(qw/foo proxypass/);
# $mech->request($r);
is( $mech->status, 200, "status is 200" );
$mech->content_contains( "test_proxy realm:foo", "test_proxy realm:foo output" );
}
view all matches for this distribution
view release on metacpan or search on metacpan
"requires" : {
"Catalyst::Controller" : "0",
"File::Spec" : "0",
"FindBin" : "0",
"HTTP::Headers" : "0",
"HTTP::Request" : "0",
"Module::Metadata" : "0",
"Test::Exception" : "0",
"Test::MockObject" : "0",
"Test::MockObject::Extends" : "0",
"Test::More" : "0",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Authentication/Credential/OAuth.pm view on Meta::CPAN
use MooseX::Types::Moose qw/ Bool HashRef /;
use MooseX::Types::Common::String qw/ NonEmptySimpleStr /;
use Net::OAuth;
#$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0A;
use LWP::UserAgent;
use HTTP::Request::Common;
use String::Random qw/ random_string /;
use Catalyst::Exception ();
use namespace::autoclean;
our $VERSION = '0.04';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Authentication/Store/Crowd.pm view on Meta::CPAN
use warnings;
use Moose;
use LWP::UserAgent;
use HTTP::Request;
use JSON;
use Catalyst::Authentication::Store::Crowd::User;
has 'find_user_url' => (
lib/Catalyst/Authentication/Store/Crowd.pm view on Meta::CPAN
sub _crowd_get_user {
my ( $self, $username ) = @_;
my $ua = LWP::UserAgent->new;
my $uri = $self->find_user_url."?username=$username";
my $req = HTTP::Request->new( 'GET', $uri );
$req->authorization_basic(
$self->app->{app_name},
$self->app->{password}
);
$req->header('Accept' => 'application/json');
view all matches for this distribution
view release on metacpan or search on metacpan
build_requires:
Catalyst::Component::InstancePerContext: '0'
Catalyst::Test: '0'
File::Spec: '0'
FindBin: '0'
HTTP::Request::Common: '0'
Test::Most: '0.34'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 5.036, CPAN::Meta::Converter version 2.150001'
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/WWW/Mechanize/Catalyst.pm view on Meta::CPAN
# no-one *should* be returning non-absolute URLs, but if they
# are then we'd better cope with it. Let's create a new URI, using
# our request as the base.
my $uri = URI->new_abs( $location, $request->uri )->as_string;
my $referral = HTTP::Request->new( GET => $uri );
return $self->request( $referral, $arg, $size, $response );
} else {
$response->{_raw_content} = $response->content;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/rest/create.t view on Meta::CPAN
use RestTest;
use DBICTest;
use Test::More;
use Test::WWW::Mechanize::Catalyst 'RestTest';
use HTTP::Request::Common;
use JSON::MaybeXS;
my $json = JSON::MaybeXS->new(utf8 => 1);
my $mech = Test::WWW::Mechanize::Catalyst->new;
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/MyTest.pm view on Meta::CPAN
# The MIT (X11) License
#
package MyTest;
use Plack::Test;
use Test::More;
use HTTP::Request::Common;
use JSON;
use base 'Exporter';
our @EXPORT = qw(test_json GET POST encode_json);
my $app = require MyApp;
sub POST {
my ($target, %args) = @_;
return HTTP::Request::Common::POST($target, %args, "Content-Type" => "application/json");
}
sub test_json {
my ($req, $json, $msg) = @_;
test_psgi $app, sub {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/HTTP/Request.pm view on Meta::CPAN
#line 1
package HTTP::Request;
require HTTP::Message;
@ISA = qw(HTTP::Message);
$VERSION = "5.811";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/HTTP/Request/Common.pm view on Meta::CPAN
#line 1
package HTTP::Request::Common;
use strict;
use vars qw(@EXPORT @EXPORT_OK $VERSION $DYNAMIC_FILE_UPLOAD);
$DYNAMIC_FILE_UPLOAD ||= 0; # make it defined (don't know why)
inc/HTTP/Request/Common.pm view on Meta::CPAN
require Exporter;
*import = \&Exporter::import;
@EXPORT =qw(GET HEAD PUT POST);
@EXPORT_OK = qw($DYNAMIC_FILE_UPLOAD);
require HTTP::Request;
use Carp();
$VERSION = "5.811";
my $CRLF = "\015\012"; # "\r\n" is not portable
inc/HTTP/Request/Common.pm view on Meta::CPAN
sub PUT { _simple_req('PUT' , @_); }
sub POST
{
my $url = shift;
my $req = HTTP::Request->new(POST => $url);
my $content;
$content = shift if @_ and ref $_[0];
my($k, $v);
while (($k,$v) = splice(@_, 0, 2)) {
if (lc($k) eq 'content') {
inc/HTTP/Request/Common.pm view on Meta::CPAN
sub _simple_req
{
my($method, $url) = splice(@_, 0, 2);
my $req = HTTP::Request->new($method => $url);
my($k, $v);
while (($k,$v) = splice(@_, 0, 2)) {
if (lc($k) eq 'content') {
$req->add_content($v);
$req->header("Content-Length", length(${$req->content_ref}));
view all matches for this distribution
view release on metacpan or search on metacpan
t/PostApp/script/post.pl view on Meta::CPAN
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;
use Encode;
my $ua = LWP::UserAgent->new();
print "REQUEST: =============\n";
my $message = <<SOAP;
<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
<Body>World</Body>
</Envelope>
SOAP
my $request = HTTP::Request->new('POST','http://localhost:3000/ws/hello');
$request->content_type('application/soap+xml');
$request->content_encoding('utf8');
$request->content(encode_utf8($message));
my $response = $ua->request($request);
print "RESPONSE: ============\n";
t/PostApp/script/post.pl view on Meta::CPAN
$message = <<SOAP;
<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
<Body><hello>World</hello></Body>
</Envelope>
SOAP
$request = HTTP::Request->new('POST','http://localhost:3000/ws2');
$request->content_type('application/soap+xml');
$request->content_encoding('utf8');
$request->content(encode_utf8($message));
$response = $ua->request($request);
print "MENSAGEM 2============\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Controller/WrapCGI.pm view on Meta::CPAN
use mro 'c3';
extends 'Catalyst::Controller';
use Catalyst::Exception ();
use HTTP::Request::AsCGI ();
use HTTP::Request ();
use URI ();
use URI::Escape;
use HTTP::Request::Common;
use namespace::clean -except => 'meta';
=head1 NAME
lib/Catalyst/Controller/WrapCGI.pm view on Meta::CPAN
=head2 wrap_cgi
C<< $self->wrap_cgi($c, $coderef) >>
Runs C<$coderef> in a CGI environment using L<HTTP::Request::AsCGI>, returns an
L<HTTP::Response>.
The CGI environment is set up based on C<$c>.
The environment variables to pass on are taken from the configuration for your
lib/Catalyst/Controller/WrapCGI.pm view on Meta::CPAN
=cut
sub wrap_cgi {
my ($self, $c, $call) = @_;
my $req = HTTP::Request->new(
map { $c->req->$_ } qw/method uri headers/
);
my $body = $c->req->body;
my $body_content = '';
lib/Catalyst/Controller/WrapCGI.pm view on Meta::CPAN
my $path_info = '/'.join '/' => map {
utf8::is_utf8($_) ? uri_escape_utf8($_) : uri_escape($_)
} @{ $c->req->args };
my $env = HTTP::Request::AsCGI->new(
$req,
($username ? (REMOTE_USER => $username) : ()),
PATH_INFO => $path_info,
# eww, this is likely broken:
FILEPATH_INFO => '/'.$c->action.$path_info,
view all matches for this distribution
view release on metacpan or search on metacpan
author:
- 'John Napiorkowski <jjnapiork@cpan.org>'
build_requires:
Catalyst: '5.90093'
Catalyst::Test: '0'
HTTP::Request::Common: '0'
Moose: '2.1403'
MooseX::MethodAttributes: '0'
Test::Most: '0.34'
Types::Standard: '0'
configure_requires:
view all matches for this distribution
view release on metacpan or search on metacpan
t/author-live_component_controller_action_streaming.t view on Meta::CPAN
{
if ( $ENV{CATALYST_SERVER} ) {
skip "Using remote server", 1;
}
# XXX: Length should be undef here, but HTTP::Request::AsCGI sets it
is( $response->content_length, 12, 'Response Content-Length' );
}
is( $response->content,, <<'EOF', 'Content is a stream' );
foo
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Engine/Embeddable.pm view on Meta::CPAN
and get the response.
It works by using the arguments that are passed from the
handle_request method in the Catalyst module to the prepare_request
method in the engine, which will then handle the request as coming
from the HTTP::Request object passed, instead of trying to fetch the
elements from the ENV, like the CGI engine does.
As the handle_request method only returns the response code and not
the response object at all, in the case you want the complete response
you need to pass a second argument which is a scalar ref where the
lib/Catalyst/Engine/Embeddable.pm view on Meta::CPAN
This information will be stored as $c->req->{_engine_embeddable}{req} and
$c->req->{_engine_embeddable}{res} for future usage.
=item $engine->prepare_headers($c)
This is where the headers are fetched from the HTTP::Request object
and set into $c->req.
=item $engine->prepare_path($c)
Get the path info from the HTTP::Request object.
=item $engine->prepare_query_parameters($c)
Set the query params from the HTTP::Request to the catalyst request.
=item $engine->prepare_body($c)
Gets the body of the HTTP::Request, creates an HTTP::Body object, and
set it in $c->req->{_body}, then being compatible with
Catalyst::Engine from now on.
=item $engine->finalize_headers($c)
lib/Catalyst/Engine/Embeddable.pm view on Meta::CPAN
=back
=head1 SEE ALSO
L<Catalyst::Engine>, L<Catalyst::Engine::CGI>, L<HTTP::Request>,
L<HTTP::Reponse>, L<Catalyst>
=head1 AUTHORS
Daniel Ruoso C<daniel@ruoso.com>
view all matches for this distribution
view release on metacpan or search on metacpan
t/live_component_controller_action_streaming.t view on Meta::CPAN
{
if ( $ENV{CATALYST_SERVER} ) {
skip "Using remote server", 1;
}
# XXX: Length should be undef here, but HTTP::Request::AsCGI sets it
is( $response->content_length, 12, 'Response Content-Length' );
}
is( $response->content,, <<'EOF', 'Content is a stream' );
foo
view all matches for this distribution