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
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
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
view release on metacpan or search on metacpan
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
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
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
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
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
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
view release on metacpan or search on metacpan
lib/Cookies/Roundtrip.pm view on Meta::CPAN
use HTTP::Cookies;
use HTTP::CookieJar;
use Firefox::Marionette::Cookie;
use HTTP::Date qw(str2time parse_date time2str);
use HTTP::Response;
use HTTP::Request;
use DateTime;
use HTTP::Headers::Util qw/join_header_words/;
use Data::Compare;
use Devel::StackTrace; # until the module is stable
lib/Cookies/Roundtrip.pm view on Meta::CPAN
$httpcookies->set_cookie(@$parsed_setcookie_array);
if( $verbosity > 0 ){ print STDOUT "${whoami}, line ".__LINE__." (via $parent): inserting 1 Set-Cookies into HTTP::Cookies which now has ".count_httpcookies($httpcookies, undef, $verbosity)." cookies.\n" }
# this way is bogus, what with response and request and url and all
# my $response = HTTP::Response->new(200);
# my $request = HTTP::Request->new(GET => $url);
# $response->request($request);
# $response->header('Set-Cookie2', $newasc); # TODO: does it push multiple Cookie headers or overrides?
# if( ! defined $httpcookies->extract_cookies($response) ){ print STDERR "--begin cookies:\n".as_string_setcookies($setcookies)."\n--end cookies.\n\n"."${whoami}, line ".__LINE__." (via $parent): error, call to ".'httpcookies->extract_cookies()'." h...
# if( $verbosity > 0 ){ print STDOUT "${whoami}, line ".__LINE__." (via $parent): inserting 1 Set-Cookies into HTTP::Cookies which now has ".count_httpcookies($httpcookies, undef, $verbosity)." cookies.\n" }
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Coro/Amazon/SimpleDB.pm view on Meta::CPAN
REPLACE_AMAZON_SIMPLEDB_CLIENT_HTTPPOST: {
package Amazon::SimpleDB::Client;
use common::sense;
use AnyEvent::HTTP;
use HTTP::Request;
use HTTP::Response;
# The only mention of a time-out in Amazon::SimpleDB::Client is in
# reference to a select operation. I'm using the value from there
# (5 seconds) as the default time-out for HTTP requests, as it
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CouchDB/Client.pm view on Meta::CPAN
our $VERSION = '0.09';
use JSON::Any qw(XS JSON DWIW);
use LWP::UserAgent qw();
use HTTP::Request qw();
use Encode qw(encode);
use Carp qw(confess);
use CouchDB::Client::DB;
lib/CouchDB/Client.pm view on Meta::CPAN
if (ref $content) {
$content = encode('utf-8', $self->{json}->encode($content));
$headers = HTTP::Headers->new('Content-Type' => 'application/json');
}
my $res = $self->{ua}->request( HTTP::Request->new($meth, $self->uriForPath($path), $headers, $content) );
my $ret = {
status => $res->code,
msg => $res->status_line,
success => 0,
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crop/HTTP/Request.pm view on Meta::CPAN
package Crop::HTTP::Request;
use base qw/ Crop::Object::Simple /;
=begin nd
Class: Crop::HTTP::Request
HTTP request.
Base class for particular gateways such FastCGI, PSGI, CGI.
Attributes contain start and finish time besides regular HTTP data.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crop/HTTP/Request.pm view on Meta::CPAN
package Crop::HTTP::Request;
use base qw/ Crop::Object::Simple /;
=begin nd
Class: Crop::HTTP::Request
HTTP request.
Base class for particular gateways such FastCGI, PSGI, CGI.
Attributes contain start and finish time besides regular HTTP data.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CrowdSec/Client.pm view on Meta::CPAN
package CrowdSec::Client;
use strict;
use Date::Parse;
use HTTP::Request::Common;
use JSON;
use LWP::UserAgent;
use Moo;
use POSIX "strftime";
view all matches for this distribution
view release on metacpan or search on metacpan
script/ct-submit.pl view on Meta::CPAN
while (my ($log_name, $log_url) = each %logs) {
write_log("\nSending request to $log_url");
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new('POST', $log_url . '/ct/v1/add-chain', ['Content-Type' => 'application/json'], $json_data);
my $res = $ua->request($req);
if (!$res->is_success) {
write_log('Failed: ', $res->status_line, "\n");
next;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/OpenPGP/KeyServer.pm view on Meta::CPAN
my($address) = @_;
my $ua = LWP::UserAgent->new;
$ua->agent('Crypt::OpenPGP/' . Crypt::OpenPGP->VERSION);
my $url = $server->{keyserver} . '?op=index&search=' .
uri_escape($address);
my $req = HTTP::Request->new(GET => $url);
my $res = $ua->request($req);
return $server->error("HTTP error: " . $res->status_line)
unless $res->is_success;
my $page = $res->content;
my @kb;
lib/Crypt/OpenPGP/KeyServer.pm view on Meta::CPAN
$key_id = unpack 'H*', $key_id;
my $ua = LWP::UserAgent->new;
$ua->agent('Crypt::OpenPGP/' . Crypt::OpenPGP->VERSION);
$key_id = substr($key_id, -8, 8);
my $url = $server->{keyserver} . '?op=get&search=0x' . $key_id;
my $req = HTTP::Request->new(GET => $url);
my $res = $ua->request($req);
return $server->error("HTTP error: " . $res->status_line)
unless $res->is_success;
my $page = $res->content;
my($key) = $page =~ /(-----BEGIN PGP PUBLIC KEY BLOCK-----.*?-----END PGP PUBLIC KEY BLOCK-----)/s;
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
eval {
eval "require LWP::UserAgent"; die $@ if $@;
my $ua = LWP::UserAgent->new;
$ua->agent("crypt-pbc-fetcher/1.0");
my $req = HTTP::Request->new(GET => "http://voltar.org/pbcfiles/pbc-$ver.tar.gz");
my $res = $ua->request($req, "pbc-$ver.tar.gz");
$worked = 1 if $res->is_success;
};
warn "LWP fetch problem: $@\n" if $@;
view all matches for this distribution
view release on metacpan or search on metacpan
eg/lwp-ssl-test view on Meta::CPAN
$opt_cadir && ( $ENV{HTTPS_CA_DIR} = $opt_cadir );
my $url = shift || 'https://www.nodeworks.com';
my $ua = new LWP::UserAgent;
$ua->timeout(15);
my $req = new HTTP::Request('HEAD', $url);
my $res = $ua->request($req);
print Dumper($res);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypto/NanoRPC.pm view on Meta::CPAN
package Crypto::NanoRPC;
use 5.018001;
use strict;
use warnings;
use HTTP::Request;
use LWP::UserAgent;
use JSON;
require Exporter;
our @ISA = qw(Exporter);
lib/Crypto/NanoRPC.pm view on Meta::CPAN
my $class = shift;
my $self = {
url => shift,
};
$self->{url} = 'http://[::1]:7076' unless defined $self->{url};
$self->{request} = HTTP::Request->new( 'POST', $self->{url} );
$self->{request}->content_type('application/json');
$self->{ua} = LWP::UserAgent->new;
bless $self, $class;
return $self;
}
lib/Crypto/NanoRPC.pm view on Meta::CPAN
These modules are required:
=over 1
=item HTTP::Request
=item LWP::UserAgent
=item JSON
view all matches for this distribution