[Catalyst] Re: Large requests with JSON?

Aristotle Pagaltzis pagaltzis at gmx.de
Tue Feb 9 10:36:57 GMT 2010


* Bill Moseley <moseley at hank.org> [2010-02-06 23:35]:
> 1) create a new user in account #1234 with name, email, etc.

This is just a normal form POST.

> 2) create a user but also provide a photo when creating the user

I might separate this out into two requests – whatever the POST
request returns would contain a link to which the client can PUT
the photo.

> 3) upload a document for the user and the document must include
> an associated collection of meta data (e.g. filename,
> timestamp, author etc.). The uploaded document must include
> this meta data before it can be accepted.

That sounds like the case I was thinking about: just do a PUT
request with X-MyApp-Filename, X-MyApp-Timestamp etc headers.

(Another option, which is better in some ways I think, would be
the two-request approach as above, though that would be more
complicated. Ie. the client POSTs the metadata, the server files
the data away temporarily and returns a link to which the client
can PUT the file, and only once that request has succeeded does
the server store both metadata and file in their proper place.)

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list