Created
March 16, 2017 19:29
-
-
Save shentonfreude/856901d24bc4b99a795eb97c04a228c3 to your computer and use it in GitHub Desktop.
Verify we can read an HTTP Range of bytes with Perl's LWP library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Read a range of bytes from HTTP file | |
use LWP; | |
my $url = 'http://example.com/alex.jpg'; | |
my $browser = LWP::UserAgent->new; | |
my @ns_headers = ('Range' => 'bytes=0-80'); | |
my $response = $browser->get($url, @ns_headers); | |
print "Resp content:", $response->content; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment