[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Option #6: Using POST for uploading associated resources
Janne Jalkanen wrote:
Cons:
o It's not as full featured as WebDAV; it solves only the uploading
problem; it doesn't allow for full control of a namespace by the
client (but that might be a pro for the server side...)
o Doesn't solve the binary-content-in-XML problem at all (not a goal
of this solution)
o Requires URL rewriting by the client
o If user really just wants to upload a picture with a little
metadata, requires two uploads: this one, plus an Atom entry with
some sort of "no, look over here!" link inside.
So, in order to upload, say three images I just took, and an entry, I
need to do seven transactions?
1) upload image #1
2) upload metadata for image #1
3) upload image #2
4) upload metadata for image #2
5) upload image #3
6) upload metadata for image #3
7) Combine results from steps 1-6, rewrite URLs in the entry, then
upload entry.
If this is a common case, I'd prefer something like this:
1) Upload image #1
2) Upload image #2
3) Upload image #3
4) Rewrite URLs in a referring entry
5) Post metadata for images #1,#2,#3 in a single Atom post, along with
the entry
But, I'm not sure what the use case for this would be. You have images,
they each need metadata, _and_ you need to tie them together with an
HTML entry as well?
By the same logic, we would need (8) - upload metadata for the entry :)
No, the entry carries metadata without need to mention it. :) That is,
in the proposal, wherever you see "entry", read "entry with content,
possibly (X)HTML, and standard Atom metadata".
What if there was just a simple way to upload the metadata for the
binary objects, and the entry would still be separate? Use just MIME
multipart to upload the image (essentially combining 1&2, 3&4, and
5&6). That would be somewhere half-way between the suggested "put
everything in a single, gigantic multipart message" and the Option
#6. That would also mean that there would be no need for the server
to do any URL rewriting, as the entry would still be separate.
Some people seem very opposed to using MIME. I'm not personally, but I
think there might be objections to requiring its support.
I really think that the common case is going to be:
(1) Upload a picture of a cat using POST, which itself has no metadata
of its own.
(2) Post an Atom entry containing metadata _about the entry_, with HTML
text like this:
Hey, look at my cat! <img src="..." align="right"/>
Not sure what you mean about URL rewriting. There is always a need for
URL rewriting, as long as the entry contains references to the binary
objects. See cat example above.
o Authentication for upload would have to be HTTP-based (Basic or
Digest auth?) rather than something more XML-based, unless I'm
missing something.
WSSE should work well here.
Good point, it's just an HTTP header.
-John