Subject: Re: MIME registration for application/gdiff

From: Lisa Dusseault <[email-masked]>
Date: Mon, 27 Sep 2004 09:36:59 -0700

>
>
> However, I'm not totally sure whether e.g. in HTTP, this should
> be used as a media type. What happens if some resource is negotiated
> by content type (e.g. like for
> http://www.w3.org/International/iri-edit/draft-duerst-iri)?
> How do the client and the server make sure they apply the diff
> to the same representation of the resource?
>
> Regards,   Martin.

The design of the PATCH headers, and whether to use a MIME type in the 
Content-Type field or whether to apply an instance manipulation, has 
already been discussed in the HTTP Working Group mailing list somewhat, 
so I'm cc'ing ietf-http-wg and bcc'ing ietf-types (in replying to 
Martin's mail on ietf-types).

I wasn't aware of any servers that actually allowed content negotiation 
between static representations.  I did think about this problem, but as 
far as I know there's no standard way of telling the server to create a 
new representation of an existing resource.  What happens if you have a 
resource that is in one Content-Type and you PUT a body that's another 
Content-Type?  I would think the correct action would normally be for 
the server to replace the resource with one of a new Content-Type.  How 
do you create a new representation of an existing resource in a new 
content type and how does that request differ from overwriting an 
existing representation with the new content type?

How does <http://www.w3.org/International/iri-edit/draft-duerst-iri> 
work?  Is it a dynamic resource where the different output content 
types are generated from XML by the server?  Or is it really a static 
resource that has several static stored representations of different 
types?  If it's the former, then there's no problem with PATCH as 
designed, as far as I can see.  If it's a static resource, then I'd 
need to know how those different representations are created and 
modified, as I'm unaware of any standard way of doing so.

Lisa

---

From: Julian Reschke <[email-masked]>
Date: Mon, 27 Sep 2004 18:47:30 +0200

Lisa Dusseault wrote:
 > ...
> work?  Is it a dynamic resource where the different output content types 
> are generated from XML by the server?  Or is it really a static resource 
> that has several static stored representations of different types?  If 
> it's the former, then there's no problem with PATCH as designed, as far 
> as I can see.  If it's a static resource, then I'd need to know how 
> those different representations are created and modified, as I'm unaware 
> of any standard way of doing so.

I agree that the issue of PATCHing a content-negotiated resource is 
identical to applying PUT to it. So whatever the answer for PUT is, it 
also should apply to PATCH.

As far as I know, the current wisdom seems to disallow put on a 
content-negotiated resource, and to modify the "content" resource 
(Content-Location response header, see 
<http://greenbytes.de/tech/webdav/rfc2616.html#header.content-location>) 
instead.

Best regards, Julian

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

---

From: Jamie Lokier <[email-masked]>
Date: Mon, 27 Sep 2004 20:56:18 +0100

Lisa Dusseault wrote:
> between static representations.

You mean like servers which send an image as GIF or PNG depending on
whether the client supports PNG, to minimise the file size or add
colour space information when supported?

-- Jamie

---

From: Martin Duerst <[email-masked]>
Date: Tue, 28 Sep 2004 08:58:10 +0900

Hello Lisa,

At 09:36 04/09/27 -0700, Lisa Dusseault wrote:

>already been discussed in the HTTP Working Group mailing list somewhat, so 
>I'm cc'ing ietf-http-wg and bcc'ing ietf-types (in replying to Martin's 
>mail on ietf-types).

If that has been looked at, then it probably should be okay.

>Content-Type?  I would think the correct action would normally be for the 
>server to replace the resource with one of a new Content-Type.  How do you 
>create a new representation of an existing resource in a new content type 
>and how does that request differ from overwriting an existing 
>representation with the new content type?
>
>How does <http://www.w3.org/International/iri-edit/draft-duerst-iri> work?

There are three actual files on the server,
http://www.w3.org/International/iri-edit/draft-duerst-iri.xml
http://www.w3.org/International/iri-edit/draft-duerst-iri.txt
http://www.w3.org/International/iri-edit/draft-duerst-iri.html
and they get content negotiated, but of course can also be
accessed directly. I'm not sure exactly what this is in your
terminology.

Regards,    Martin.

>Is it a dynamic resource where the different output content types are 
>generated from XML by the server?  Or is it really a static resource that 
>has several static stored representations of different types?  If it's the 
>former, then there's no problem with PATCH as designed, as far as I can 
>see.  If it's a static resource, then I'd need to know how those different 
>representations are created and modified, as I'm unaware of any standard 
>way of doing so.
>
>Lisa

---

From: "Roy T. Fielding" <[email-masked]>
Date: Tue, 28 Sep 2004 03:55:02 -0700

On Sep 27, 2004, at 9:47 AM, Julian Reschke wrote:
> <http://greenbytes.de/tech/webdav/rfc2616.html#header.content- 
> location>) instead.

That is correct.  The best response from an HTTP server to an authoring
type of method on a negotiated resource is either "not allowed" or a
300 response that explains the resource is negotiated and lists the
URI(s) that might be authorable.  On a PUT, servers will either disallow
the request or change the URI's resource to having the fixed content.

Providing those URIs is a hard problem in general because it depends
on the algorithm used by the server to determine what representations
are available for a given URI.  For example, the Multiviews method in
Apache works by filename extensions, whereas another method uses
mappings defined in a URI".var" file, and mod_rewrite could do just
about anything.

A server should never attempt to "guess" while authoring -- any
redirection of the content must be controlled by the user (for
privacy reasons) and must not be assumed by the server (for
security reasons).

....Roy

---

From: Lisa Dusseault <[email-masked]>
Date: Tue, 28 Sep 2004 09:27:15 -0700

>> work?
Then I imagine the authoring model must be that the client can PUT an 
application/xml file to draft-duest-iri.xml, PUT a text/plain file to 
draft-duerst-iri.txt, and so on.  The resource draft-duerst-iri may not 
truly exist and it might be either forbidden or cause confusion if the 
client tries to PUT to that URL.    By that model, the PATCH method 
could work exactly the same with its existing syntax.  Only the 
GET/HEAD methods actually do content negotiation.  Probably PROPFIND 
and PROPPATCH and other WebDAV methods are undefined, or if they are 
defined they'd work independently on each resource, so that for example 
PROPFIND 'getcontentlength' to the text file would retrieve the text 
file's length.

It would certainly be interesting if some day this were 
formalized/standardized.

Lisa