Hi folks:
I've got a very simple use case, and I am trying to wrap my head
around how to use Mojo::UserAgent for this. The concept is very
simple. I want to issue a GET to a server from the user agent, which
will respond with a chunked response. Blocking isn't an issue on the
client side, this is actually for a CLI application talking to an API.
The API provides a non-chunked response and a chunked response
capability for larger operations (more data returned).
What I would like to do at the outset is something akin to
use Mojo::UserAgent;
$ua = Mojo::UserAgent->new;
$tx = $ua->get($url);
and have the ua object handle all the chunked streaming from the
server. This is the blocking case. The non-blocking case seems to be
documented here:
http://search.cpan.org/~sri/Mojolicious-5.60/lib/Mojolicious/Guides/Cookbook.pod#Streaming_request
though I am not sure I grasp it well enough to use it.
Is the above code snippet ok for starters, or do I need to do the
streaming variant? I am guessing the latter, but I figured I'd start by
asking ...
Thx!
Joe
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.