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: : question

2017-07-28 Thread ToddAndMargo
On 07/28/2017 02:52 PM, Brandon Allbery wrote: On Fri, Jul 28, 2017 at 5:49 PM, ToddAndMargo > wrote: On 07/28/2017 02:41 PM, Brandon Allbery wrote: > That's not Perl, it's JSON generated by Perl. Mumble, mumble ... I have a hard enough ti

Re: : question

2017-07-28 Thread Timo Paulssen
This article uses httpbin.org which is a nice service that'll take any kind of request and tell you exactly what it saw. It shows what it got as a json dictionary literal. Here's an example for your browser, so you can just click it: http://httpbin.org/anything?hello-todd-how-are-you=very-go

Re: : question

2017-07-28 Thread Brandon Allbery
On Fri, Jul 28, 2017 at 5:49 PM, ToddAndMargo wrote: > On 07/28/2017 02:41 PM, Brandon Allbery wrote: >>> > That's not Perl, it's JSON generated by Perl. > > Mumble, mumble ... I have a hard enough time learning > Perl without someone throwing in another language. > Mumble ... > You're doi

Re: : question

2017-07-28 Thread ToddAndMargo
Now I am really confused. It is all over the place on http://perl6maven.com/simple-web-client For instance: { "args": { "language": "Perl", "math": "19+23=42", "name": "Larry Wall" }, "

Re: : question

2017-07-28 Thread Brandon Allbery
That's not Perl, it's JSON generated by Perl. On Fri, Jul 28, 2017 at 5:39 PM, ToddAndMargo wrote: > On 07/28/2017 02:02 PM, Timo Paulssen wrote: > >> The first one is valid perl 6 code and the bottom one is not. It's >> likely you were looking at JSON (or equivalently JavaScript) and >> confuse

Re: : question

2017-07-28 Thread ToddAndMargo
On 07/28/2017 02:02 PM, Timo Paulssen wrote: The first one is valid perl 6 code and the bottom one is not. It's likely you were looking at JSON (or equivalently JavaScript) and confused that with perl6 code. Now I am really confused. It is all over the place on http://perl6maven.com/simple-we

Re: : question

2017-07-28 Thread Timo Paulssen
The first one is valid perl 6 code and the bottom one is not. It's likely you were looking at JSON (or equivalently JavaScript) and confused that with perl6 code.

: question

2017-07-28 Thread ToddAndMargo
Hi All, Is this "User-Agent" => "Perl 6 Maven articles" the same as this? "User-Agent": "Perl 6 Maven articles" And are we assigning to reference pointer or are we addressing a hash pair? Many thanks, -T

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