<br><br><div class="gmail_quote">On Sat, Jan 23, 2010 at 5:39 PM, Hans Dieter Pearcey <span dir="ltr">&lt;<a href="mailto:hdp.perl.catalyst.users@weftsoar.net">hdp.perl.catalyst.users@weftsoar.net</a>&gt;</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&#39;s message of Sat Jan 23 19:45:28 -0500 2010:<br>
<div class="im"><br>
&gt; With a jpeg I assume the content type would be form-data (that included an<br>
&gt; upload in the form) where the file ends up in $req-&gt;uploads, not as a<br>
&gt; request parameter.<br>
<br>
</div>That assumption may hold true for *your* applications, but he didn&#39;t say<br>
anything about a form or even a web browser.  It&#39;s perfectly reasonable,<br>
especially in the context of REST APIs, to talk about non-form-based request<br>
bodies.  (I&#39;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&#39;s a different content type.  I assumed form-data.  So, in this case in my &quot;HTTP::Body deserialization layer&quot; approach, I&#39;d thus add:</div>

<div><br></div><div>   $HTTP::Body::Types(&#39;application/vnd.ms-excel&#39;) = &#39;My::ExcelParser&#39;;</div><div><br></div><div>which would result in $req-&gt;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-&gt;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>