view release on metacpan or search on metacpan
lib/CGI/Application/MailPage.pm view on Meta::CPAN
my $callback = $self->param('read_file_callback');
$buffer = $callback->($filename);
} elsif( $self->param('remote_fetch') && ($page =~ /^https?:\/\//) ) {
#fetch this page with LWP
require LWP::UserAgent;
require HTTP::Request;
my $agent = LWP::UserAgent->new();
my $response = $agent->request(HTTP::Request->new(GET => $page));
if( $response->is_success ) {
$buffer = $response->content();
} else {
return $self->error("Unable to retrieve remote page $page");
}
lib/CGI/Application/MailPage.pm view on Meta::CPAN
my $buffer = $callback->($filename);
push(@lines, split("\n", $buffer));
} elsif( $self->param('remote_fetch') && ($page =~ /^https?:\/\//) ) {
#fetch this page with LWP
require LWP::UserAgent;
require HTTP::Request;
my $agent = LWP::UserAgent->new();
my $response = $agent->request(HTTP::Request->new(GET => $page));
if( $response->is_success ) {
my $buffer = $response->content();
@lines = split(/\r?\n/, $buffer);
} else {
return $self->error("Unable to retrieve remote page $page");
lib/CGI/Application/MailPage.pm view on Meta::CPAN
my $callback = $self->param('read_file_callback');
$html_tree->parse( $callback->($filename) );
} elsif( $self->param('remote_fetch') && ($page =~ /^https?:\/\//) ) {
#fetch this page with LWP
require LWP::UserAgent;
require HTTP::Request;
my $agent = LWP::UserAgent->new();
my $response = $agent->request(HTTP::Request->new(GET => $page));
if( $response->is_success ) {
my $buffer = $response->content();
$html_tree->parse($buffer);
} else {
return $self->error("Unable to retrieve remote page $page");
view all matches for this distribution
view release on metacpan or search on metacpan
$res = $ua->post("http://127.0.0.1:$port/", { name => "baz" });
like $res->content, qr/Hello baz/;
like $res->content_type, qr/plain/;
$res = $ua->simple_request(HTTP::Request->new(GET => "http://127.0.0.1:$port/?rm=hello_redir"));
is $res->code, 302;
is $res->header('location'), '/foo';
},
server => sub {
my $port = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Search.pm view on Meta::CPAN
# Search::Tools::HiLiter doesn't like blank searches so handle those on our own
if( -e $page ) {
$content = decode_utf8(read_file($page));
} else {
require HTTP::Request;
require LWP::UserAgent;
my $ua = LWP::UserAgent->new();
my $request = HTTP::Request->new( GET => $page);
my $response = $ua->request($request);
if ( $response->is_error ) {
warn "Error: Couldn't get '$page': response code " . $response->code . "\n";
return;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Server.pm view on Meta::CPAN
print $response->as_string();
return 1; # Like ...Simple::Static::serve_static does
}
# Shamelessly stolen from HTTP::Request::AsCGI by chansen
sub _build_response {
my ( $self, $stdout ) = @_;
$stdout =~ s{(.*?\x0d?\x0a\x0d?\x0a)}{}xsm;
my $headers = $1;
lib/CGI/Application/Server.pm view on Meta::CPAN
This is a subclass of L<HTTP::Server::Simple> and all of its caveats
apply here as well.
=head1 ACKNOWLEDGEMENTS
The HTTP response handling was shamelessly stolen from L<HTTP::Request::AsCGI>
by chansen
=head1 AUTHORS
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
AuthRegister.pm view on Meta::CPAN
print $HTMLstart, $LoginMsg; exit; }
if ($casurl !~ /^https:\/\//i) {
my $u = CGI::url(); $u=~ s/\/[^\/]+$//; $casurl = "$u/$casurl"; }
require LWP::UserAgent; require HTTP::Request; require Mozilla::CA;
my $ua = LWP::UserAgent->new();
use HTTP::Request::Common qw(POST);
my $req = POST $casurl, [ rt=>'verify', username=>$username, stoken=>$stoken ];
my $resp = $ua->request($req);
my $result = 'fail';
if ($resp->is_success) {
my $message = $resp->decoded_content; $message =~ s/\s//g;
view all matches for this distribution
view release on metacpan or search on metacpan
my $ua = LWP::UserAgent->new(conn_cache => LWP::ConnCache->new());
$ua->agent($0);
# Turn off proxy, because the proxy may not pass on all
# information back to here. Squid does that :-(
$ua->no_proxy($ARGV[0]);
my $request = HTTP::Request->new(GET => $ARGV[0]);
$request->protocol('HTTP/1.1');
# HTTP::Response object
my $r = $ua->request($request);
view all matches for this distribution
view release on metacpan or search on metacpan
use Test::More;
use CGI::Compile;
use CGI;
use Test::Requires qw(CGI::Emulate::PSGI Plack::Test HTTP::Request::Common);
use CGI::Emulate::PSGI;
use Plack::Test;
use HTTP::Request::Common;
my $sub = CGI::Compile->compile("t/hello.cgi");
my $app = CGI::Emulate::PSGI->handler($sub);
test_psgi app => $app, client => sub {
view all matches for this distribution
view release on metacpan or search on metacpan
t/05_lint.t view on Meta::CPAN
use strict;
use Test::More;
use Test::Requires qw( Plack::Test HTTP::Request Plack::Middleware::Lint );
use Test::Requires {
'Plack' => 0.9981,
};
use CGI::Emulate::PSGI;
t/05_lint.t view on Meta::CPAN
my $app = CGI::Emulate::PSGI->handler(sub { print $output });
$app = Plack::Middleware::Lint->wrap($app);
Plack::Test::test_psgi($app, sub {
my $cb = shift;
my $res = $cb->(HTTP::Request->new(GET => "/"));
is $res->code, 302;
});
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
bin/testjson.pl view on Meta::CPAN
use autodie qw(:all);
use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
my $req = HTTP::Request->new(POST => 'https://localhost/cgi-bin/info.pl');
$req->header('content-type' => 'application/json');
$req->content('{ "first": "Nigel", "last": "Horne" }');
my $resp = $ua->request($req);
if($resp->is_success()) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/090.14838.t view on Meta::CPAN
BEGIN {
if ( !$Config{d_fork} ) {
plan skip_all => "fork not available on this platform";
}
eval "use HTTP::Request::Common";
plan skip_all => "HTTP::Request::Common not available"
if $@;
plan tests => 1;
}
my $req = HTTP::Request::Common::POST(
'/dummy_location',
Content_Type => 'form-data',
Content => [ test_file => ["t/090.14838.t"], ]
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Untaint/Facebook.pm view on Meta::CPAN
return 0;
}
$url = $value;
}
my $request = HTTP::Request->new('HEAD' => $url);
$request->header('Accept' => 'text/html');
if($ENV{'HTTP_ACCEPT_LANGUAGE'}) {
$request->header('Accept-Language' => $ENV{'HTTP_ACCEPT_LANGUAGE'});
}
my $browser = LWP::UserAgent->new();
view all matches for this distribution
view release on metacpan or search on metacpan
[INTERNALS]
- Migrated Makefile.PL to use Module::Install. This allows me to keep the hairy
Makefile.PL stuff I have, but easily add 'no_index' and 'recommends' metadata.
- test suite clean up.
- new required modules: Scalar::Util and HTTP::Request::Common
1.2 Thu Dec 15 22:35:39 EST 2005
[BUG FIXES]
- Fixed bug in store_uploads() from improper hash usage.
view all matches for this distribution
view release on metacpan or search on metacpan
doc/html2ps view on Meta::CPAN
}
sub gu {
if($package{'libwww-perl'}) {
require LWP::UserAgent;
$ua=new LWP::UserAgent;
$req = HTTP::Request->new(GET => $url);
$req->authorization_basic(@_) if(@_);
$ua->agent($spoof) if($spoof);
my $res = $ua->request($req);
$code=$res->code;
$contyp=$res->header('content-type');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CMS/MediaWiki.pm view on Meta::CPAN
use strict;
my $package = __PACKAGE__;
our $VERSION = '0.8014';
use LWP::UserAgent;
use HTTP::Request::Common;
# GLOBAL VARIABLES
my %Var = ();
my $contentType = "";
my $ua;
view all matches for this distribution
view release on metacpan or search on metacpan
CachingProxy.pm view on Meta::CPAN
$cache->set($CK, 1, $expire ); # doesn't seem like we should have to do this, but apparently we do
warn "[DEBUG] getting $URL\n" if $this->{debug};
my $fh = $cache->handle( $CK, ">", $expire );
my $request = HTTP::Request->new(GET => $URL);
my $announced_header;
my $response = $this->{ua}->request($request, sub {
my $chunk = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Faker/HTTPD.pm view on Meta::CPAN
files under the fake CPAN. Can be overriden during construction.
=head2 app
Coderef that will be passed to L<Test::Fake::HTTPD/run>. It converts the
L<HTTP::Request> object to a L<PSGI> environment hash before transferring
control on to the L</server>. Can be overriden during construction.
=head2 dest
Directory in which to construct the CPAN instance. Same as in L<CPAN::Faker>,
view all matches for this distribution
view release on metacpan or search on metacpan
t/data-test/resources.yml view on Meta::CPAN
HTML::Form: 1.038
HTML::HeadParser: 0
HTML::Parser: 3.33
HTML::TokeParser: 2.28
HTTP::Daemon: 0
HTTP::Request: 1.3
HTTP::Server::Simple: 0.35
HTTP::Server::Simple::CGI: 0
HTTP::Status: 0
LWP: 5.829
LWP::UserAgent: 5.829
view all matches for this distribution
view release on metacpan or search on metacpan
data/tiddlers.json view on Meta::CPAN
"modified": "20260430021612817",
"created": "20240706052320581"
},
{
"created": "20240717002307158",
"text": "\"\"\"\no V 1.49:\n- 2026-06-26\n- Add AES-GCM-SIV, Gitea, Quadtree, Sagan, Suricata to [[Acronyms]]\n- Add Aion::Env, Util::CommandLine to CommandLineStuff\n- Add Algorithm::Classifier::IsolationForest to AlgorithmicStuff\n- Add Alg...
"title": "ChangeLog1",
"modified": "20260702002558540"
},
{
"created": "20260702002534921",
data/tiddlers.json view on Meta::CPAN
"title": "HTMLHandling",
"modified": "20260630220405112",
"created": "20200930063306239"
},
{
"text": "\"\"\"\no See also:\n- BrowserStuff\n- ChildProcesses\n- DnsStuff\n- EventStuff\n- FileHandling\n- HashHandling\n- [[HTMLHandling]]\n- [[HTTPServers]]\n- LoggingStuff\n- ParallelProcessing\n- PlackServer\n- TheRFCGuide\n- RestfulInte...
"title": "HTTPHandling",
"modified": "20260525063545597",
"created": "20210922020640121"
},
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Mini/Inject/REST/Client/API.pm view on Meta::CPAN
package CPAN::Mini::Inject::REST::Client::API;
use Moose;
use Carp qw/confess/;
use HTTP::Request::Common;
use JSON;
use MIME::Base64;
use REST::Client;
use Try::Tiny;
use URI;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Mini/Inject/Remote.pm view on Meta::CPAN
use Params::Validate qw/validate
SCALAR/;
use File::Spec;
use YAML::Any qw/LoadFile/;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use Data::Dumper;
use Carp;
=head1 NAME
view all matches for this distribution
view release on metacpan or search on metacpan
t/WebserverTester.pm view on Meta::CPAN
# Copied and adapted from the CPAN-Mini-Webserver-0.51 distribution
use strict;
use warnings;
use HTTP::Request;
use Plack::Test;
use Test::Builder;
use URI;
use URI::QueryParam;
t/WebserverTester.pm view on Meta::CPAN
while ( @_ ) {
my $name = shift;
my $value = shift;
$uri->query_param($name, $value);
}
my $req = HTTP::Request->new(GET => $uri);
my $res;
test_psgi $app, sub {
my ( $cb ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
conf/config-deb.yaml view on Meta::CPAN
---
global:
fix_meta_yml_modules:
- HTTP::Request::AsCGI
fix_module_name:
- from: Template::Toolkit
to: Template
fix_package_depends: []
no_depends:
view all matches for this distribution
view release on metacpan or search on metacpan
}
},
"runtime" : {
"requires" : {
"ExtUtils::MakeMaker" : "5.4302",
"HTTP::Request" : "0",
"LWP::UserAgent" : "0"
}
}
},
"release_status" : "stable",
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/TestSQL.pm view on Meta::CPAN
'LWP::Protocol::gopher' => 1,
'LWP::ConnCache' => 1,
'Net::HTTPS' => 1,
'HTTP::Cookies' => 1,
'HTTP::Message' => 1,
'HTTP::Request::Common' => 1,
'HTTP::Headers::Auth' => 1,
'LWP::Protocol::loopback' => 1,
'HTTP::Response' => 1,
'HTTP::Cookies::Netscape' => 1,
'LWP::Authen::Ntlm' => 1,
'LWP::Authen::Basic' => 1,
'WWW::RobotRules' => 1,
'LWP::Protocol' => 1,
'HTTP::Request' => 1,
'LWP' => 1,
'LWP::MediaTypes' => 1,
'LWP::Protocol::data' => 1,
'HTTP::Negotiate' => 1,
'LWP::Protocol::https' => 1,
t/lib/TestSQL.pm view on Meta::CPAN
},
'LWP::EventLoop' => {
'dist_name' => 'LWPng-alpha',
'mod_vers' => '0.11'
},
'HTTP::Request' => {
'dist_name' => 'libwww-perl',
'mod_vers' => '1.40'
},
'MIME::Base64::Perl' => {
'dist_name' => 'MIME-Base64-Perl',
t/lib/TestSQL.pm view on Meta::CPAN
},
'HTTP::Cookies' => {
'dist_name' => 'libwww-perl',
'mod_vers' => '1.39'
},
'HTTP::Request::Common' => {
'dist_name' => 'libwww-perl',
'mod_vers' => '1.26'
},
'Digest::HMAC_SHA1' => {
'dist_name' => 'Digest-HMAC',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Search/Author.pm view on Meta::CPAN
use 5.006;
use strict; use warnings;
use overload q("") => \&as_string, fallback => 1;
use Data::Dumper;
use HTTP::Request;
use LWP::UserAgent;
use HTML::Entities qw/decode_entities/;
our $DEBUG = 0;
lib/CPAN/Search/Author.pm view on Meta::CPAN
my $self = shift;
my $id = shift;
my $browser = $self->{_browser};
$browser->env_proxy;
my $request = HTTP::Request->new(POST=>qq[http://search.cpan.org/search?query=$id&mode=author]);
my $response = $browser->request($request);
print {*STDOUT} "Search By Id [$id] Status: " . $response->status_line . "\n" if $DEBUG;
die("ERROR: Couldn't connect to search.cpan.org.\n") unless $response->is_success;
my $contents = $response->content;
lib/CPAN/Search/Author.pm view on Meta::CPAN
die("ERROR: Invalid letter [$letter].\n") unless ($letter =~ /[A-Z]/i);
my $browser = $self->{_browser};
$browser->env_proxy;
my $request = HTTP::Request->new(POST=>qq[http://search.cpan.org/author/?$letter]);
my $response = $browser->request($request);
print {*STDOUT} "Search Id Starts With [$letter] Status: " . $response->status_line . "\n" if $DEBUG;
die("ERROR: Couldn't connect to search.cpan.org.\n") unless $response->is_success;
my $contents = $response->content;
lib/CPAN/Search/Author.pm view on Meta::CPAN
sub where_name_contains {
my ($self, $query) = @_;
my $browser = $self->{_browser};
$browser->env_proxy;
my $request = HTTP::Request->new(POST=>qq[http://search.cpan.org/search?query=$query&mode=author]);
my $response = $browser->request($request);
print {*STDOUT} "Search By Name Contains [$query] Status: " . $response->status_line . "\n" if $DEBUG;
die("ERROR: Couldn't connect to search.cpan.org.\n") unless $response->is_success;
my $contents = $response->content;
view all matches for this distribution
view release on metacpan or search on metacpan
t/data/metabase.sql view on Meta::CPAN
INSERT INTO `metabase` (guid,id,updated,report) VALUES ('0cbce1be-07f0-11e3-9db1-878205732d18',33578672,'2013-08-18T10:22:13Z','{\"CPAN::Testers::Fact::LegacyReport\":{\"content\":\"{\\\"osversion\\\":\\\"8.0-release\\\",\\\"archname\\\":\\\"i386-fre...
INSERT INTO `metabase` (guid,id,updated,report) VALUES ('5ad79194-6cdc-1014-b4e3-38f2223f278b',33578876,'2013-08-18T10:34:33Z','{\"CPAN::Testers::Fact::LegacyReport\":{\"content\":\"{\\\"osversion\\\":\\\"5.2\\\",\\\"archname\\\":\\\"MSWin32-x86-mult...
INSERT INTO `metabase` (guid,id,updated,report) VALUES ('66261f56-07f3-11e3-ac5a-df7f19362e69',33579060,'2013-08-18T10:46:12Z','{\"CPAN::Testers::Fact::LegacyReport\":{\"content\":\"{\\\"osversion\\\":\\\"8.0-release\\\",\\\"archname\\\":\\\"i386-fre...
INSERT INTO `metabase` (guid,id,updated,report) VALUES ('b35d7c0c-07f2-11e3-afab-ccf1a108922b',33578988,'2013-08-18T10:41:12Z','{\"CPAN::Testers::Fact::LegacyReport\":{\"content\":\"{\\\"osversion\\\":\\\"8.0-release\\\",\\\"archname\\\":\\\"i386-fre...
INSERT INTO `metabase` (guid,id,updated,report) VALUES ('ffdb8ffc-07f1-11e3-a0a5-bfc8c70fa3a9',33578912,'2013-08-18T10:36:11Z','{\"CPAN::Testers::Fact::LegacyReport\":{\"content\":\"{\\\"osversion\\\":\\\"8.0-release-p4\\\",\\\"archname\\\":\\\"i386-...
view all matches for this distribution
view release on metacpan or search on metacpan
t/var/nntp-testers/5928865 view on Meta::CPAN
Catalyst::View::TT 0.31 0
CatalystX::Component::Traits 0.14 0.13
CatalystX::InjectComponent 0.024 0
ExtUtils::MakeMaker 6.55_02 6.42
HTML::FormHandler 0.28001 0.26001
HTTP::Request::Common 5.824 0
Moose 0.92 0
Moose::Autobox 0.10 0.09
MooseX::MethodAttributes 0.18 0.18
MooseX::RelatedClassRoles 0.004 0.004
MooseX::Types 0.20 0
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Testers/WWW/Statistics/Graphs.pm view on Meta::CPAN
use File::Basename;
use File::Path;
use HTML::Entities;
use IO::File;
use LWP::UserAgent;
use HTTP::Request;
# -------------------------------------
# Variables
my %month = (
lib/CPAN/Testers/WWW/Statistics/Graphs.pm view on Meta::CPAN
$self->{parent}->_log("url - [".(length $url)."] $url");
# print "$url\n";
my $res;
eval {
my $req = HTTP::Request->new(GET => $url);
$res = $lwp->request($req);
};
if($@ || !$res->is_success()) {
$file = "$results-$r.html";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Uploader.pm view on Meta::CPAN
#pod =cut
use Carp ();
use File::Basename ();
use File::Spec;
use HTTP::Request::Common qw(POST);
use HTTP::Status;
use LWP::UserAgent;
my $UPLOAD_URI = $ENV{CPAN_UPLOADER_UPLOAD_URI}
|| 'https://pause.perl.org/pause/authenquery?ACTION=add_uri';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN.pm view on Meta::CPAN
LWP => [ # we frequently had "Can't locate object
# method "new" via package "LWP::UserAgent" at
# (eval 69) line 2006
sub {require LWP},
sub {require LWP::UserAgent},
sub {require HTTP::Request},
sub {require URI::URL;
unless (CPAN::Version->vge(URI::URL::->VERSION,0.08)) {
for ("Will not use URI::URL, need 0.08\n") {
$CPAN::Frontend->mywarn($_);
die $_;
view all matches for this distribution