While you are right that they don't encode properly, it seems there was an existing solution: the puppet app recognizes an 'Accept: s' header that means it'll return the file as-is.
The working example would be:my $ua = LWP::UserAgent->new(); my $ay = HTTP::Headers->new; $ay->head +er('Accept' => 'YAML'); my $as = HTTP::Headers->new; $as->header('Acc +ept' => 's'); my @osini; my @partini; my $req = HTTP::Request->new('GET', "https://$server/production/file_m +etadata/test/hm.jpg", $ay); my $res = $ua->request($req); die "Something went wrong: $res->status_line" unless $res->is_su +ccess; @osini = YAML::Load($res->content."\n"); my $md5 = $osini[0]->{checksum}; $md5 =~ s/^{md5}//; $req = HTTP::Request->new('GET', "https://$server/production/fil +e_bucket_file/md5/$md5", $as); $res = $ua->request($req); open AAA,'>aaa.jpg'; binmode AAA; print AAA $res->content;
In reply to Re^4: Load large(ish) files with YAML?
by rgcosma
in thread Load large(ish) files with YAML?
by rgcosma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |