<br><br><div class="gmail_quote">On Sat, Jan 23, 2010 at 5:39 PM, Hans Dieter Pearcey <span dir="ltr"><<a href="mailto:hdp.perl.catalyst.users@weftsoar.net">hdp.perl.catalyst.users@weftsoar.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Excerpts from Bill Moseley's message of Sat Jan 23 19:45:28 -0500 2010:<br>
<div class="im"><br>
> With a jpeg I assume the content type would be form-data (that included an<br>
> upload in the form) where the file ends up in $req->uploads, not as a<br>
> request parameter.<br>
<br>
</div>That assumption may hold true for *your* applications, but he didn't say<br>
anything about a form or even a web browser. It's perfectly reasonable,<br>
especially in the context of REST APIs, to talk about non-form-based request<br>
bodies. (I've written actions that accepted PUT requests with a content-type<br>
of application/vnd.ms-excel, for example.)<br></blockquote><div><br></div><div>But, that's a different content type. I assumed form-data. So, in this case in my "HTTP::Body deserialization layer" approach, I'd thus add:</div>
<div><br></div><div> $HTTP::Body::Types('application/vnd.ms-excel') = 'My::ExcelParser';</div><div><br></div><div>which would result in $req->uploads having an upload object for the spreadsheet. My::ExcelParser would probably be a thin sub-class of something like My::Upload. Then the same controller would work with both a web request with an upload field or this REST request and expect to find the upload object in $req->uploads.</div>
<div><br></div><div><br></div><div> </div></div>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org">moseley@hank.org</a><br>