Questions tagged [lwp-useragent]

The LWP::UserAgent is a class implementing a web user agent in the libwww-perl library.

The LWP::UserAgent is a class implementing a web user agent in the libwww-perl library by Michael Schilli. This class provides the option to setup various configuration options when making HTTP requests, allowing control over headers, cookies, credentials, protocols, proxies and many others.

For example, using a combination of these settings allow the request sender to pretend he is a certain user with certain characteristics - for example, a Windows user that uses Mozilla Firefox 19.0, has certain cookies in his browser and has obtained HTTP auth credentials.

225 questions
11
votes
2 answers

LWP::UserAgent Insists on verifying hostname

The following script works returns a comprehensive headers on a host running libwww-perl-5.836 but not on the host using libwww-perl-6.30.0. In that case, the script displays the following: 500 Can't connect to backend.mutegroup.org:443…
Stephen Rasku
  • 2,554
  • 7
  • 29
  • 51
10
votes
3 answers

Using LWP with SSL and client certificates

I'm porting an application from PHP/cURL to Perl and LWP::UserAgent. I need to do a POST request to a web server and provide a client certificate and key file. The PHP code I'm trying to replicate is this: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,…
kent
  • 195
  • 1
  • 3
  • 11
9
votes
1 answer

LWP::UserAgent HTTP Basic Authentication

I tried to run this perl5 program: #!/usr/bin/env perl use strict; use warnings; …
XoR
  • 2,556
  • 4
  • 17
  • 15
9
votes
2 answers

Display LWP::UserAgent download progress

I'm downloading a large file directly to a file with Perl using LWP::UserAgent and the :content_file option. This is a simplified example of my code: require LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(3600); $ua->env_proxy; my…
nanocv
  • 2,227
  • 2
  • 14
  • 27
9
votes
4 answers

Why don't my LWP::UserAgent credentials work?

I'm trying to access a protected file. Server is using digest authentication - which I can see from the printed out response. Here is the sample code: use LWP; use strict; my $url = 'http://somesite.com/aa/bb/cc.html'; my $username = 'scott'; my…
Ram
  • 3,034
  • 11
  • 38
  • 46
8
votes
1 answer

Perl: LWP::UserAgent returns always code 200 for redirected urls

I have a simple url which does a 302 temp. move to another page. I try to get to if the URL returns code 200 (for OK) to retrieve it and to stop if something else than 200 is returned. My code: my $ua = LWP::UserAgent->new( env_proxy => 1,keep_alive…
NovumCoder
  • 4,349
  • 9
  • 43
  • 58
8
votes
3 answers

How can I make LWP::UserAgent appear to have Flash installed?

I have a Perl script that uses LWP::UserAgent to download a webpage which it then processes using regular expressions. The problem is that portions of the webpage which are regular HTML aren't being returned to LWP::UserAgent since the site…
Russell C.
  • 1,649
  • 6
  • 33
  • 55
7
votes
1 answer

LWP::UserAgent Can't Post with TLS1.1

Getting 500 handshaker error:443 over https. The host service I am sending XML to does not support TLS 1.2, they do support 1.0 and 1.1. Currently using LWP 6.03 on CentOS 6. Using the code below they claim I am still sending using TLS1.2 use…
chrisrth
  • 1,182
  • 3
  • 15
  • 36
7
votes
2 answers

How to fail over

If I use wget to retrieve something from the geonames.org server, it reports two IP addresses, and the first one fails but it gets it from the second: Resolving ws.geonames.org (ws.geonames.org)... 5.9.41.208, 176.9.107.169 Connecting to…
Paul Tomblin
  • 179,021
  • 58
  • 319
  • 408
7
votes
3 answers

handle lwp timeout effectively

I am using LWP to download content from web pages, and I would like to limit the amount of time it waits for a page. This is accomplished in lwp like this: my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->get($url); And this works fine, except…
srchulo
  • 5,143
  • 4
  • 43
  • 72
6
votes
3 answers

How to make a HTTP PUT request using LWP?

I'm trying to change this request to a HTTP PUT request, any idea how ? my $request = LWP::UserAgent->new; my $response = $request->get($url, "apikey", $apiKey, "requestDate", $requestDate);
Stephane
  • 4,978
  • 9
  • 51
  • 86
6
votes
2 answers

How to accept self-signed certificates with LWP::UserAgent

I am attempting to set up a node.js server that uses HTTPS. I will then write a scripts in Perl to make a HTTPS request to the server and measure latency of the round trip. Here is my node.js: var express = require('express'); var https =…
gotthecodes
  • 273
  • 3
  • 12
6
votes
2 answers

Perl LWP::UserAgent cannot connect to HTTPS

I have a script which is used to get content from Google. It work very well, but now it doesn't. I found a post on stackexchange and I upgrade the library version, but it still doesn't work: I cannot Connect to any HTTPS site using LWP::UserAgent I…
Adrian
  • 149
  • 2
  • 6
6
votes
1 answer

I cannot Connect to any HTTPS site using LWP::UserAgent

I am trying to create a script that simply just connect to a website. However, for some reason it will not connect to anything that is using HTTPS. We have a proxy enabled here. However, I believe the proxy is not the problem, because if I were to…
theEli
  • 85
  • 5
6
votes
8 answers

Automating sms sending by through Way2sms in Perl

I am trying to send sms through Way2sms using Perl LWP. The login part is being successful, after which I save the cookies to a local file. The welcome page after being logged in shows a Send SMS link, clicking on which one is redirected to another…
SexyBeast
  • 7,913
  • 28
  • 108
  • 196
1
2 3
14 15