HTTP::Request::Common and form-data with PUT
[email protected] (Bill Moseley) Thu, 31 May 2012 08:18:10 -0500
| Newsgroups | perl.libwww |
|---|---|
| Message-ID | <CAKhN_m5dg5ADR=MWmMjJ9CDYyK7X4OFiZ-yJrZeAwSHzFpGj7g@mail.gmail.com> |
We have a RESTful type of API and we have a logical object that contains an
audio file. We can use HTTP::Request::Common to POST this object but PUT
doesn't work to update because the code for form-data seems to be specific
to the POST method in HTTP::Request::Common.
For example,
my $req = PUT(
$url,
Content_Type => 'form-data',
Content => [
audio_file => [ $path_to_audio_file ],
],
);
Not a SCALAR reference at /Users/moseley/perl5/lib/perl5/HTTP/Message.pm
line 158.
because it thinks I'm providing a callback for add_content.
Is there a reason why POST and PUT should not behave the same other than
the HTTP method name used?
Thanks,
--
Bill Moseley
[email protected]