|
|
| There's more than one way to do things | |
| PerlMonks |
How to make an HTTP request with an equivalent of curl's --max-time?by Cody Fendant (Hermit) |
| on Jan 14, 2015 at 06:04 UTC ( [id://1113194]=perlquestion: print w/replies, xml ) | Need Help?? |
|
Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question: I'm grabbing data from a special Twitter firehose-type URL. It will send information indefinitely*, so in order to manage the amount of data received by the script, it's recommended to use the maximum-time option. Here's what I'm doing, a system() call containing:
Where $header is some OAuth magic. So, is it possible to do this without the shell-out to curl and keep it all within Perl? As far as I can see, that maximum time option isn't directly related to HTTP Headers, it's curl-specific. * Updated to add documentation on this "indefinitely" thing. From the Twitter documentation:: To connect to the Streaming API, form a HTTP request and consume the resulting stream for as long as is practical. Our servers will hold the connection open indefinitely, barring server-side error, excessive client-side lag, network hiccups, routine server maintenance or duplicate logins.
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||