Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 05:54 PM, ToddAndMargo wrote: On 07/28/2017 12:48 PM, ToddAndMargo wrote: On 07/28/2017 04:31 AM, Gabor Szabo wrote: On Fri, Jul 28, 2017 at 9:49 AM, ToddAndMargo wrote: Hi All, I am trying to convert a p5 program to p6. What do I use in place of `LWP::UserAgent`? I use it fo

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 07:03 PM, Timo Paulssen wrote: there's an example in the readme that goes like this: my $curl = LibCurl::Easy.new(:verbose, :followlocation); the followlocation part should be right for you I love it. Thank you! -- ~~~ Serious error. All sho

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread Timo Paulssen
there's an example in the readme that goes like this: my $curl = LibCurl::Easy.new(:verbose, :followlocation); the followlocation part should be right for you

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 06:55 PM, Timo Paulssen wrote: If you use the other interface where you create a curl object a la LibCurl::Easy.new, you can just $my_curl_object.Host("the-host.com"); $my_curl_object.referer("example.com"); $my_curl_object.cookie("the-cookie"); $my_curl_object.

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread Timo Paulssen
If you use the other interface where you create a curl object a la LibCurl::Easy.new, you can just $my_curl_object.Host("the-host.com"); $my_curl_object.referer("example.com"); $my_curl_object.cookie("the-cookie"); $my_curl_object.useragent("me"); hth - Timo

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 06:49 PM, Timo Paulssen wrote: Did you not see this part of the readme? # And if you need headers, pass them inside a positional Hash: say post 'https://httpbin.org/post?foo=42&bar=x', %(:Some), :some, :42args; Thank you. What a nightmare to figure out. -- ~~~

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 06:36 PM, Bennett Todd wrote: As for LWP being a pain, I see it differently, filling the specs for a web client --- many specs --- is a pain. The curl project is trying to wrap a blanket around that pain. The pain is trying to figure out how to use the various headers. The doc

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread Timo Paulssen
Did you not see this part of the readme? # And if you need headers, pass them inside a positional Hash: say post 'https://httpbin.org/post?foo=42&bar=x', %(:Some), :some, :42args;

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 06:36 PM, Brian Duggan wrote: On Friday, July 28, ToddAndMargo wrote: I have been fighting with this all day and gave up an hour ago and just did a system call to curl (this is P5 code): $CurlStatus = system ( "curl -L -b $AcceptCookie $ClickHere -o $NewFileName" ); There

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 06:33 PM, Bennett Todd wrote: I just googled perl6 libcurl, and got https://github.com/CurtTilmes/perl6-libcurl That's definitely where I'd start. Hi Bennett, Looks pretty but it is too reduced function. I need to follow links and to include the following headers: Host

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread Bennett Todd
Thank you! I'd have hated for my echo of your knowledge to be the only tip he got, and you included a pointer to the option he needed, which I didn't try from my phone:-)

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread Bennett Todd
As for LWP being a pain, I see it differently, filling the specs for a web client --- many specs --- is a pain. The curl project is trying to wrap a blanket around that pain.

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread Brian Duggan
On Friday, July 28, ToddAndMargo wrote: > I have been fighting with this all day and gave up an hour ago > and just did a system call to curl (this is P5 code): > > $CurlStatus = system ( > "curl -L -b $AcceptCookie $ClickHere -o $NewFileName" ); There are also perl 6 bindings to libcurl, e

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread Bennett Todd
I just googled perl6 libcurl, and got https://github.com/CurtTilmes/perl6-libcurl That's definitely where I'd start.

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 06:07 PM, Bennett Todd wrote: I'm not expert in curl, nor even http client coding, so I just checked the curl(1) man page on my system, it says: -L, --location (HTTP) If the server reports that the requested page has moved to a different

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread Bennett Todd
I'm not expert in curl, nor even http client coding, so I just checked the curl(1) man page on my system, it says: -L, --location (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location:

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 12:48 PM, ToddAndMargo wrote: On 07/28/2017 04:31 AM, Gabor Szabo wrote: On Fri, Jul 28, 2017 at 9:49 AM, ToddAndMargo wrote: Hi All, I am trying to convert a p5 program to p6. What do I use in place of `LWP::UserAgent`? I use it for downloading files from the web. I need to

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread ToddAndMargo
On 07/28/2017 04:31 AM, Gabor Szabo wrote: On Fri, Jul 28, 2017 at 9:49 AM, ToddAndMargo wrote: Hi All, I am trying to convert a p5 program to p6. What do I use in place of `LWP::UserAgent`? I use it for downloading files from the web. I need to be able to pass the following to the web page

Re: Need sub for `LWP::UserAgent`

2017-07-28 Thread Gabor Szabo
On Fri, Jul 28, 2017 at 9:49 AM, ToddAndMargo wrote: >>> Hi All, >>> >>> I am trying to convert a p5 program to p6. What do I use in >>> place of `LWP::UserAgent`? >>> >>> I use it for downloading files from the web. I need to be able >>> to pass the following to the web page: >>> >>> Caller

Re: Need sub for `LWP::UserAgent`

2017-07-27 Thread ToddAndMargo
>> Hi All, >> >> I am trying to convert a p5 program to p6. What do I use in >> place of `LWP::UserAgent`? >> >> I use it for downloading files from the web. I need to be able >> to pass the following to the web page: >> >> Caller >> Host >> UserAgent >> Referer >> Cookies >>

Re: Need sub for `LWP::UserAgent`

2017-07-27 Thread Gabor Szabo
LWP::Simple now allows you to set the header of your request. See my recent article with examples: http://perl6maven.com/simple-web-client I hope this helps. regards Gabor On Fri, Jul 28, 2017 at 7:42 AM, Todd Chester wrote: > Hi All, > > I am trying to convert a p5 program to p6. What do I