Result:
found more than 589 distributions - search limited to the first 2001 files matching your query ( run in 1.455 )


Circle-Common

 view release on metacpan or  search on metacpan

lib/Circle/Common.pm  view on Meta::CPAN

use strict;
use warnings;
use Exporter 'import';
use URL::Encode qw(url_encode_utf8);
use LWP::UserAgent;
use HTTP::Request;
use Slurp;
use Try::Tiny;
use YAML;
use JSON;
use Carp;

lib/Circle/Common.pm  view on Meta::CPAN

        ];
    }
    else {
        $header = [ 'Content-Type' => 'application/json; charset=UTF-8' ];
    }
    my $request  = HTTP::Request->new( 'POST', $url, $header, encode_json($data) );
    my $response = $ua->request($request);
    if ( $response->is_success ) {
        return decode_json( $response->decoded_content );
    }
    else {

lib/Circle/Common.pm  view on Meta::CPAN

        ];
    }
    else {
        $header = [ 'Content-Type' => 'application/json; charset=UTF-8' ];
    }
    my $request  = HTTP::Request->new( 'GET', $url, $header );
    my $response = $ua->request($request);
    if ( $response->is_success ) {
        return decode_json( $response->decoded_content );
    }
    else {

 view all matches for this distribution


Cisco-ACI

 view release on metacpan or  search on metacpan

lib/Cisco/ACI.pm  view on Meta::CPAN

use strict;
use warnings;

use Carp;
use JSON;
use HTTP::Request;
use LWP;
use XML::Simple;
use Cisco::ACI::Rule;
use Cisco::ACI::FvcapRule;
use Cisco::ACI::FvAEPg;

lib/Cisco/ACI.pm  view on Meta::CPAN

sub __request {
	my ( $self, $uri, $data ) = @_;
	my $r;

	if ( $data ) {
		$r = HTTP::Request->new( POST => $uri );
		$r->content( $data );
	}
	else {
		$r = HTTP::Request->new( GET => $uri );
	}

	my $s = $self->{ __ua }->request( $r );
	$self->{ error } = "Login failure: $!" unless $s->is_success;

 view all matches for this distribution


Cisco-IPPhone

 view release on metacpan or  search on metacpan

IPPhone.pm  view on Meta::CPAN

 my $xml = $myexecute->Content_Noheader;
 
 # Translate non-alpha chars into hex
 $xml = URI::Escape::uri_escape("$xml"); 
 
 my $request = new HTTP::Request POST => "$POSTURL";
 $request->authorization_basic($USER, $PASSWORD);
 $request->content("XML=$xml"); # Phone requires parameter named XML
 my $response = $ua->request($request); # Send the POST
 
 if ($response->is_success) {

 view all matches for this distribution


Cisco-UCS

 view release on metacpan or  search on metacpan

lib/Cisco/UCS.pm  view on Meta::CPAN

			);

	$self->{uri} = $self->{proto}. '://' .$self->{cluster}
				. ':' .$self->{port}. '/nuova';

	$self->{req} = HTTP::Request->new(
					POST => $self->{uri}
			);

	$self->{req}->content_type( 'application/x-www-form-urlencoded' );

 view all matches for this distribution


CloudApp-REST

 view release on metacpan or  search on metacpan

lib/CloudApp/REST.pm  view on Meta::CPAN


use Moose;
use MooseX::Types::URI qw(Uri);

use LWP::UserAgent;
use HTTP::Request;
use JSON::XS;
use Module::Load;
use Data::Dumper;

=head1 NAME

lib/CloudApp/REST.pm  view on Meta::CPAN

    $self->useragent->requests_redirectable([]) if $params->{noredirect};

    my $res;
    unless (exists $body{file}) {
        $self->_debug("New request, URI is $uri");
        my $req = HTTP::Request->new;
        $req->header(Accept => 'application/json');
        $req->content_type('application/json');
        $req->uri($uri);

        $req->method('GET');

 view all matches for this distribution


Cmd-Dwarf

 view release on metacpan or  search on metacpan

examples/helloworld/app/lib/App/Test.pm  view on Meta::CPAN

use Dwarf::Pragma;
use parent 'Exporter';
use Data::Dumper;
use JSON;
use HTTP::Cookies;
use HTTP::Request::Common qw/GET HEAD PUT POST DELETE/;
use Plack::Test;
use Test::More;
use WWW::Mechanize;
use App;

examples/helloworld/app/lib/App/Test.pm  view on Meta::CPAN


		my @a = ($uri->as_string);
		push @a, @args if $method !~ /^(get|delete)$/i;
		$method = uc $method;

		# HTTP::Request::Common が PATCH をサポートしてないのでワークアラウンド
		if ($method eq 'PATCH') {
			$method = 'POST';
			$method = \&$method;
			$req = $method->(@a);
			$req->method('PATCH');

 view all matches for this distribution


Cogwheel

 view release on metacpan or  search on metacpan

ex/httpd.pl  view on Meta::CPAN

    no Cogwheel;
}

{

    package My::HTTP::Request;
    use Moose;

    has raw => (
        isa     => 'HTTP::Request',
        is      => 'rw',
        handles => [qw(protocol uri header)],
    );

    has start_time => (

ex/httpd.pl  view on Meta::CPAN


{

    package My::HTTP::Server::Plugin;
    use Cogwheel;
    use HTTP::Request;
    use HTTP::Response;
    use HTTP::Status qw( status_message is_info RC_BAD_REQUEST );
    use POE qw(Filter::HTTPD);
    use Time::HiRes qw( time );
    use HTTP::Date;

ex/httpd.pl  view on Meta::CPAN

    sub OK()    { 1 }
    sub DEFER() { 0 }
    sub BAD()   { undef }

    has request => (
        isa       => 'My::HTTP::Request',
        is        => 'rw',
        predicate => 'has_request',
        clearer   => 'clear_request',
        lazy      => 1,
        default   => sub { My::HTTP::Request->new() },
        handles   => [qw(content has_content content_length)],
    );

    has response => (
        isa       => 'HTTP::Response',

 view all matches for this distribution


CohortExplorer

 view release on metacpan or  search on metacpan

lib/CohortExplorer/Application/Opal/Datasource.pm  view on Meta::CPAN


 # Authenticate using Opal url
 # Default Opal url is http://localhost:8080
 my $ua = LWP::UserAgent->new( timeout => 10, ssl_opts => { verify_hostname => 0 } );
(my $url = $self->url || 'http://localhost:8080' ) =~ s/\/$//;
 my $req = HTTP::Request->new( GET => $url . "/ws/datasource/$ds_name" );
 $req->header(
             Authorization => "X-Opal-Auth "
               . MIME::Base64::encode( join ':', @opts{qw/username password/} ),
             Accept => "application/json"
 );

lib/CohortExplorer/Application/Opal/Datasource.pm  view on Meta::CPAN

 # Get list of allowed variables from each table
 my $ua = LWP::UserAgent->new( timeout => 10, ssl_opts => { verify_hostname => 0 } );
(my $url = $self->url || 'http://localhost:8080' ) =~ s/\/$//;
 for my $t ( @{ $param{allowed_tables} } ) {
  my $entity_req =
    HTTP::Request->new(
                    GET => $url . "/ws/datasource/$ds_name/table/$t/entities" );
  $entity_req->header(
             Authorization => "X-Opal-Auth "
               . MIME::Base64::encode( join ':', @opts{qw/username password/} ),
             Accept => "application/json"

lib/CohortExplorer/Application/Opal/Datasource.pm  view on Meta::CPAN


  # Get the first identifier
  if ( $entity_res->code == 200 ) {
   my $decoded_json = decode_json( $entity_res->decoded_content );
   my $var_req =
     HTTP::Request->new(   GET => $url
                         . "/ws/datasource/$ds_name/table/$t/valueSet/"
                         . ( $decoded_json->[0]->{identifier} || '' ) );
   $var_req->header(
             Authorization => "X-Opal-Auth "
               . MIME::Base64::encode( join ':', @opts{qw/username password/} ),

 view all matches for this distribution


Compiler-Parser

 view release on metacpan or  search on metacpan

t/app/Plack/Request.t  view on Meta::CPAN


Tokuhiro Matsuno

=head1 SEE ALSO

L<Plack::Response> L<HTTP::Request>, L<Catalyst::Request>

=head1 LICENSE

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

 view all matches for this distribution


Conclave-OTK

 view release on metacpan or  search on metacpan

lib/Conclave/OTK/Backend/4store.pm  view on Meta::CPAN

package Conclave::OTK::Backend::4store;
# ABSTRACT: OTK backend for 4store
use parent qw/Conclave::OTK::Backend/;

use LWP::UserAgent;
use HTTP::Request::Common qw/PUT DELETE/;

sub new {
  my ($class, $base_uri, %opts) = @_;
  my $self = bless({}, $class);

 view all matches for this distribution


Conductrics-Client

 view release on metacpan or  search on metacpan

lib/Conductrics/Client.pm  view on Meta::CPAN

use URI::QueryParam;
use JSON::MaybeXS;
use JSON::Schema;
use Time::HiRes;
use LWP::UserAgent;
use HTTP::Request;

our $VERSION = '0.003';
$VERSION = eval $VERSION;

sub build_uri { 

lib/Conductrics/Client.pm  view on Meta::CPAN

	$uri->query_param_append($k, $parameters{$k});
    }
    if ('HASH' eq ref $content) {
	$content=JSON::MaybeXS::encode_json($content);
    }
    my $request = HTTP::Request->new("PUT", $uri, undef, $content);
    $request->header(Content_Type => 'application/json');
    #use Data::Dumper;
    #print Dumper($request);
    my $response = $ua->request($request);
    if ($response->is_success) {

lib/Conductrics/Client.pm  view on Meta::CPAN

    my %parameters = (apikey=>$self->apiKey);
    for my $k (keys %parameters) {
	$uri->query_param_append($k, $parameters{$k});
    }

    my $request = HTTP::Request->new("DELETE", $uri);
    my $response = $ua->request($request);
    if ($response->is_success) {
	return JSON::MaybeXS::decode_json($response->decoded_content);
    } else {
	warn "Content: ", $response->decoded_content;  # or whatever

 view all matches for this distribution


Conduit

 view release on metacpan or  search on metacpan

lib/Conduit.pm  view on Meta::CPAN


      $response = await $app->( $request );

A code reference to the responder used for handling requests.

It will be passed an L<HTTP::Request> instance containing the incoming request
and is expected to yield an L<HTTP::Response> instance via a future. As a
small convenience, the server will fill in the C<protocol> and
C<content_length> fields of the response if they are not provided by the
responder.

 view all matches for this distribution


Config-Universal

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

name:         Config-Universal
version:      0.5
version_from: lib/Config/Universal.pm
installdirs:  site
requires:
    HTTP::Request::Common:         
    HTTP::Response:                
    LWP::UserAgent:                
    XML::DOM:                      

distribution_type: module

 view all matches for this distribution


Connector

 view release on metacpan or  search on metacpan

lib/Connector/Proxy/HTTP.pm  view on Meta::CPAN

    my $args = shift;

    my $url = $self->_sanitize_path( $args );
    $self->log()->debug('Make LWP call to ' . $url );

    my $req = HTTP::Request->new('GET' => $url);
    $self->_init_request( $req );

    my $response = $self->agent()->request($req);

    if (!$response->is_success) {

lib/Connector/Proxy/HTTP.pm  view on Meta::CPAN

        }
        $content = $data;
    }

    # create request
    my $req = HTTP::Request->new($self->http_method() => $url);
    $self->_init_request( $req );

    # set generated content
    $req->content($content);

 view all matches for this distribution


Consul-Simple

 view release on metacpan or  search on metacpan

lib/Consul/Simple.pm  view on Meta::CPAN

package Consul::Simple;
$Consul::Simple::VERSION = '1.142430';
use strict;use warnings;
use LWP::UserAgent;
use HTTP::Response;
use HTTP::Request::Common;
use MIME::Base64;
use JSON;
use Data::Dumper;

sub new {

lib/Consul/Simple.pm  view on Meta::CPAN

        %args = @args;
    }
    my $url = $self->_mk_kv_url($key);
    $url .= '?recurse' if $args{recurse};
    my $res = $self->_do_request(
        HTTP::Request::Common::_simple_req(
            'DELETE',
            $url
        )
    );
    return $res;

 view all matches for this distribution


Container-Builder

 view release on metacpan or  search on metacpan

examples/fatpacked.plackup  view on Meta::CPAN

  my $FALSE = !$TRUE;
  
  sub req_to_psgi {
      my $req = shift;
  
      unless (try { $req->isa('HTTP::Request') }) {
          Carp::croak("Request is not HTTP::Request: $req");
      }
  
      # from HTTP::Request::AsCGI
      my $host = $req->header('Host');
      my $uri  = $req->uri->clone;
      $uri->scheme('http')    unless $uri->scheme;
      $uri->host('localhost') unless $uri->host;
      $uri->port(80)          unless $uri->port;

examples/fatpacked.plackup  view on Meta::CPAN

      }
  
      $convert_resp->();
  }
  
  sub HTTP::Request::to_psgi {
      req_to_psgi(@_);
  }
  
  sub HTTP::Response::from_psgi {
      my $class = shift;

examples/fatpacked.plackup  view on Meta::CPAN

  
  __END__
  
  =head1 NAME
  
  HTTP::Message::PSGI - Converts HTTP::Request and HTTP::Response from/to PSGI env and response
  
  =head1 SYNOPSIS
  
    use HTTP::Message::PSGI;
  
    # $req is HTTP::Request, $res is HTTP::Response
    my $env = req_to_psgi($req);
    my $res = res_from_psgi([ $status, $headers, $body ]);
  
    # Adds methods to HTTP::Request/Response class as well
    my $env = $req->to_psgi;
    my $res = HTTP::Response->from_psgi([ $status, $headers, $body ]);
  
  =head1 DESCRIPTION
  
  HTTP::Message::PSGI gives you convenient methods to convert an L<HTTP::Request>
  object to a PSGI env hash and convert a PSGI response arrayref to
  a L<HTTP::Response> object.
  
  If you want the other way around, see L<Plack::Request> and
  L<Plack::Response>.

examples/fatpacked.plackup  view on Meta::CPAN

  
  =item req_to_psgi
  
    my $env = req_to_psgi($req [, $key => $val ... ]);
  
  Converts a L<HTTP::Request> object into a PSGI env hash reference.
  
  =item HTTP::Request::to_psgi
  
    my $env = $req->to_psgi;
  
  Same as C<req_to_psgi> but an instance method in L<HTTP::Request>.
  
  =item res_from_psgi
  
    my $res = res_from_psgi([ $status, $headers, $body ]);
  

examples/fatpacked.plackup  view on Meta::CPAN

  
  Tatsuhiko Miyagawa
  
  =head1 SEE ALSO
  
  L<HTTP::Request::AsCGI> L<HTTP::Message> L<Plack::Test>
  
  =cut
  
HTTP_MESSAGE_PSGI

examples/fatpacked.plackup  view on Meta::CPAN

  reference.
  
  =head2 Plack::Test
  
  L<Plack::Test> is a unified interface to test your PSGI application
  using standard L<HTTP::Request> and L<HTTP::Response> pair with simple
  callbacks.
  
  =head2 Plack::Test::Suite
  
  L<Plack::Test::Suite> is a test suite to test a new PSGI server backend.

examples/fatpacked.plackup  view on Meta::CPAN

  
  __END__
  
  =head1 NAME
  
  Plack::LWPish - HTTP::Request/Response compatible interface with HTTP::Tiny backend
  
  =head1 SYNOPSIS
  
    use Plack::LWPish;
  
    my $request = HTTP::Request->new(GET => 'http://perl.com/');
  
    my $ua = Plack::LWPish->new;
    my $res = $ua->request($request); # returns HTTP::Response
  
  =head1 DESCRIPTION
  
  This module is an adapter object that implements one method,
  C<request> that acts like L<LWP::UserAgent>'s request method
  i.e. takes HTTP::Request object and returns HTTP::Response object.
  
  This module is used solely inside L<Plack::Test::Suite> and
  L<Plack::Test::Server>, and you are recommended to take a look at
  L<HTTP::Thin> if you would like to use this outside Plack.
  

examples/fatpacked.plackup  view on Meta::CPAN

  
  Tokuhiro Matsuno
  
  =head1 SEE ALSO
  
  L<Plack::Response> L<HTTP::Request>, L<Catalyst::Request>
  
  =head1 LICENSE
  
  This library is free software; you can redistribute it and/or modify
  it under the same terms as Perl itself.

examples/fatpacked.plackup  view on Meta::CPAN

  Plack::Test - Test PSGI applications with various backends
  
  =head1 SYNOPSIS
  
    use Plack::Test;
    use HTTP::Request::Common;
  
    # Simple OO interface
    my $app = sub { return [ 200, [], [ "Hello" ] ] };
    my $test = Plack::Test->create($app);
  

examples/fatpacked.plackup  view on Meta::CPAN

            my $env = shift;
            return [ 200, [ 'Content-Type' => 'text/plain' ], [ "Hello World" ] ],
        },
        client => sub {
            my $cb  = shift;
            my $req = HTTP::Request->new(GET => "http://localhost/hello");
            my $res = $cb->($req);
            like $res->content, qr/Hello World/;
        };
  
    # positional params (app, client)

examples/fatpacked.plackup  view on Meta::CPAN

    };
  
  =head1 DESCRIPTION
  
  Plack::Test is a unified interface to test PSGI applications using
  L<HTTP::Request> and L<HTTP::Response> objects. It also allows you to run PSGI
  applications in various ways. The default backend is C<Plack::Test::MockHTTP>,
  but you may also use any L<Plack::Handler> implementation to run live HTTP
  requests against a web server.
  
  =head1 METHODS

examples/fatpacked.plackup  view on Meta::CPAN

  
  =item request
  
    $res = $test->request($request);
  
  takes an HTTP::Request object, runs it through the PSGI application to
  test and returns an HTTP::Response object.
  
  =back
  
  =head1 FUNCTIONS

examples/fatpacked.plackup  view on Meta::CPAN

    test_psgi $app, $client;
    test_psgi app => $app, client => $client;
  
  Runs the client test code C<$client> against a PSGI application
  C<$app>. The client callback gets one argument C<$cb>, a
  callback that accepts an C<HTTP::Request> object and returns an
  C<HTTP::Response> object.
  
  Use L<HTTP::Request::Common> to import shortcuts for creating requests for
  C<GET>, C<POST>, C<DELETE>, and C<PUT> operations.
  
  For your convenience, the C<HTTP::Request> given to the callback automatically
  uses the HTTP protocol and the localhost (I<127.0.0.1> by default), so the
  following code just works:
  
    use HTTP::Request::Common;
    test_psgi $app, sub {
        my $cb  = shift;
        my $res = $cb->(GET "/hello");
    };
  
  Note that however, it is not a good idea to pass an arbitrary
  (i.e. user-input) string to C<GET> or even C<<
  HTTP::Request->new >> by assuming that it always represents a path,
  because:
  
    my $req = GET "//foo/bar";
  
  would represent a request for a URL that has no scheme, has a hostname

examples/fatpacked.plackup  view on Meta::CPAN

  
  =over 4
  
  =item MockHTTP
  
  (Default) Creates a PSGI env hash out of HTTP::Request object, runs
  the PSGI application in-process and returns HTTP::Response.
  
  =item Server
  
  Runs one of Plack::Handler backends (C<Standalone> by default) and

examples/fatpacked.plackup  view on Meta::CPAN

  package Plack::Test::MockHTTP;
  use strict;
  use warnings;
  
  use Carp;
  use HTTP::Request;
  use HTTP::Response;
  use HTTP::Message::PSGI;
  use Try::Tiny;
  
  sub new {

examples/fatpacked.plackup  view on Meta::CPAN

  Plack::Test::MockHTTP - Run mocked HTTP tests through PSGI applications
  
  =head1 DESCRIPTION
  
  Plack::Test::MockHTTP is a utility to run PSGI application given
  HTTP::Request objects and return HTTP::Response object out of PSGI
  application response. See L<Plack::Test> how to use this module.
  
  =head1 AUTHOR
  
  Tatsuhiko Miyagawa

examples/fatpacked.plackup  view on Meta::CPAN

$fatpacked{"Plack/Test/Server.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'PLACK_TEST_SERVER';
  package Plack::Test::Server;
  use strict;
  use warnings;
  use Carp;
  use HTTP::Request;
  use HTTP::Response;
  use Test::TCP;
  use Plack::Loader;
  use Plack::LWPish;
  

examples/fatpacked.plackup  view on Meta::CPAN

  package Plack::Test::Suite;
  use strict;
  use warnings;
  use Digest::MD5;
  use File::ShareDir;
  use HTTP::Request;
  use HTTP::Request::Common;
  use Test::More;
  use Test::TCP;
  use Plack::Loader;
  use Plack::Middleware::Lint;
  use Plack::Util;

examples/fatpacked.plackup  view on Meta::CPAN

      [
          'big POST',
          sub {
              my $cb = shift;
              my $chunk = "abcdefgh" x 12000;
              my $req = HTTP::Request->new(POST => "http://127.0.0.1/");
              $req->content_length(length $chunk);
              $req->content_type('application/octet-stream');
              $req->content($chunk);
  
              my $res = $cb->($req);

examples/fatpacked.plackup  view on Meta::CPAN

      ],
      [
          'multi headers (request)',
          sub {
              my $cb  = shift;
              my $req = HTTP::Request->new(
                  GET => "http://127.0.0.1/",
              );
              $req->push_header(Foo => "bar");
              $req->push_header(Foo => "baz");
              my $res = $cb->($req);

examples/fatpacked.plackup  view on Meta::CPAN

      ],
      [
          'multi headers (response)',
          sub {
              my $cb  = shift;
              my $res = $cb->(HTTP::Request->new(GET => "http://127.0.0.1/"));
              my $foo = $res->header('X-Foo');
              like $foo, qr/foo,\s*bar,\s*baz/;
          },
          sub {
              my $env = shift;

examples/fatpacked.plackup  view on Meta::CPAN

      ],
      [
          'Do not set $env->{COOKIE}',
          sub {
              my $cb  = shift;
              my $req = HTTP::Request->new(
                  GET => "http://127.0.0.1/",
              );
              $req->push_header(Cookie => "foo=bar");
              my $res = $cb->($req);
              is($res->header('X-Cookie'), 0);

examples/fatpacked.plackup  view on Meta::CPAN

      ],
      [
          'request->input seekable',
          sub {
              my $cb = shift;
              my $req = HTTP::Request->new(POST => "http://127.0.0.1/");
              $req->content("body");
              $req->content_type('text/plain');
              $req->content_length(4);
              my $res = $cb->($req);
              is $res->content, 'body';

examples/fatpacked.plackup  view on Meta::CPAN

              my $cb  = shift;
              SKIP: {
                  skip "Authorization header is unsupported under CGI", 4 if ($ENV{PLACK_TEST_HANDLER} || "") eq "CGI";
  
                  {
                      my $req = HTTP::Request->new(
                          GET => "http://127.0.0.1/",
                      );
                      $req->push_header(Authorization => 'Basic XXXX');
                      my $res = $cb->($req);
                      is $res->header('X-AUTHORIZATION'), 1;
                      is $res->content, 'Basic XXXX';
                  };
  
                  {
                      my $req = HTTP::Request->new(
                          GET => "http://127.0.0.1/",
                      );
                      my $res = $cb->($req);
                      is $res->header('X-AUTHORIZATION'), 0;
                      is $res->content, 'no_auth';

 view all matches for this distribution


Continuity

 view release on metacpan or  search on metacpan

lib/Continuity/Adapt/FCGI.pm  view on Meta::CPAN


Continuity::Adapt::FCGI - Use HTTP::Daemon as a continuation server

=head1 DESCRIPTION

This module provides the glue between FastCGI Web and Continuity, translating FastCGI requests into HTTP::RequestWrapper
objects that are sent to applications running inside Continuity.

=head1 METHODS

=over

lib/Continuity/Adapt/FCGI.pm  view on Meta::CPAN

package Continuity::Adapt::FCGI::Request;
use strict;

use CGI::Util qw(unescape);
use HTTP::Headers;
use base 'HTTP::Request';
use Continuity::Request;
use base 'Continuity::Request';

# CGI query params
sub cached_params { exists $_[1] ? $_[0]->{cached_params} = $_[1] : $_[0]->{cached_params} }

lib/Continuity/Adapt/FCGI.pm  view on Meta::CPAN

sub debug_callback :lvalue { $_[0]->{debug_callback} }

=item $request = Continuity::Adapt::FCGI::Request->new($client, $id, $cgi, $query)

Creates a new C<Continuity::Adapt::FCGI::Request> object. This deletes values
from C<$cgi> while converting it into a L<HTTP::Request> object.
It also assumes $cgi contains certain CGI variables.

This code was borrowed from POE::Component::FastCGI

=cut

 view all matches for this distribution


Cookie

 view release on metacpan or  search on metacpan

lib/Cookie/Jar.pm  view on Meta::CPAN

    return( $self->error( "Response object provided is not an object." ) ) if( !Scalar::Util::blessed( $resp ) );
    my $uri;
    if( $self->_is_a( $resp, 'HTTP::Response' ) )
    {
        my $req = $resp->request;
        return( $self->error( "No HTTP::Request object is set in this HTTP::Response." ) ) if( !$resp->request );
        $uri = $resp->request->uri;
    }
    elsif( $resp->can( 'uri' ) && $resp->can( 'header' ) )
    {
        $uri = $resp->uri;

lib/Cookie/Jar.pm  view on Meta::CPAN

    my $jar = Cookie::Jar->new( request => $r ) ||
        die( "An error occurred while trying to get the cookie jar:", Cookie::Jar->error );
    # set the default host
    $jar->host( 'www.example.com' );
    $jar->fetch;
    # or using a HTTP::Request object
    # Retrieve cookies from Cookie header sent from client
    $jar->fetch( request => $http_request );
    if( $jar->exists( 'my-cookie' ) )
    {
        # do something

lib/Cookie/Jar.pm  view on Meta::CPAN


For example, Apache2::Cookie does not work well in decoding cookies, and L<Cookie::Baker> C<Set-Cookie> timestamp format is wrong. They use Mon-09-Jan 2020 12:17:30 GMT where it should be, as per rfc 6265 Mon, 09 Jan 2020 12:17:30 GMT

Also L<APR::Request::Cookie> and L<Apache2::Cookie> which is a wrapper around L<APR::Request::Cookie> return a cookie object that returns the value of the cookie upon stringification instead of the full C<Set-Cookie> parameters. Clearly they designed...

This module supports modperl and uses a L<Apache2::RequestRec> if provided, or can use package objects that implement similar interface as L<HTTP::Request> and L<HTTP::Response>, or if none of those above are available or provided, this module return...

This module is also compatible with L<LWP::UserAgent>, so you can use like this:

    use LWP::UserAgent;
    use Cookie::Jar;

lib/Cookie/Jar.pm  view on Meta::CPAN


This is an alias for L</add_request_header> for backward compatibility with L<HTTP::Cookies>

=head2 add_request_header

Provided with a request object, such as, but not limited to L<HTTP::Request> and this will add all relevant cookies in the repository into the C<Cookie> C<HTTP> request header. The object method needs to have the C<header> method in order to get, or ...

As long as the object provided supports the C<uri> and C<header> method, you can provide any class of object you want.

Please refer to the L<rfc6265|https://datatracker.ietf.org/doc/html/rfc6265> for more information on the applicable rule when adding cookies to the outgoing request header.

lib/Cookie/Jar.pm  view on Meta::CPAN


It retrieves all possible cookies from the HTTP request received from the web browser.

It takes an optional hash or hash reference of parameters, such as C<host>. If it is not provided, the value set with L</host> is used instead.

If the parameter C<request> containing an HTTP request object, such as, but not limited to L<HTTP::Request>, is provided, it will use it to get the C<Cookie> header value. The object method needs to have the C<header> method in order to get, or set t...

Alternatively, if a value for L</request> has been set, it will use it to get the C<Cookie> header value from Apache modperl.

You can also provide the C<Cookie> string to parse by providing the C<string> option to this method.

 view all matches for this distribution


Cookies-Roundtrip

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Firefox::Marionette::Cookie" : "0",
            "HTTP::CookieJar" : "0",
            "HTTP::Cookies" : "0",
            "HTTP::Date" : "0",
            "HTTP::Headers::Util" : "0",
            "HTTP::Request" : "0",
            "HTTP::Response" : "0",
            "autovivification" : "0",
            "perl" : "5.006"
         }
      },

META.json  view on Meta::CPAN

            "Firefox::Marionette::Cookie" : "0",
            "HTTP::CookieJar" : "0",
            "HTTP::CookieJar::LWP" : "0",
            "HTTP::Cookies" : "0",
            "HTTP::Date" : "0",
            "HTTP::Request" : "0",
            "HTTP::Response" : "0",
            "LWP::UserAgent" : "0",
            "Test::Deep" : "0",
            "Test::More" : "0",
            "Test::More::UTF8" : "0",

 view all matches for this distribution


( run in 1.455 second using v1.01-cache-2.11-cpan-9789f410c06 )