[Zope3-dev] Other (than GET and POST) HTTP Methods

Jim Fulton jim@zope.com
Wed, 08 Jan 2003 06:26:37 -0500


Stephan Richter wrote:
> On Tuesday 07 January 2003 14:41, Jim Fulton wrote:
> 
>>One of these days, we need to implement:
>>
>>- PUT
> 
> 
> Dumb question:

There are no dumb questions.

 > Is put used outside of WebDAV as well? If so where and how does
> it behave?

Yes, it is used by Amaya and Composer to edit web pages.
This is, in a way, a subset of WebDAV use.

This should be thought of as HTML content editing.

>>- WebDAV (which adds a bunch of additional HTTP methods)
> 
> 
> Do you have any links to docs? I will check the Z2 implementatin as well.

http://www.webdav.org/

> 
>>I've been pondering how to approach this. In particular, I've been
>>wondering how people should provide implementations of these methods.
>>
>>The alternatives I can think of are:
>>
>>- Implement HTTP Views that have methods for each of the HTTP methods
>>   other than GET and POST. I think that this is too course grained,
>>   as views would need to implement every method someone might want to
>>   use.
> 
> 
> I agree with the criticism.
> 
> 
>>- Treat each method (or some grouping of methods) as a view type.
>>   For example, we've treated the pair of methods, GET and POST as
>>   the "Browser" view type.  The problem is that I'm not sure there
>>   are good groupings. For example, WebDAV uses GET and PUT, as well as
>>   several WebDAV-specific methods.
> 
> 
> I think I like this one the best. Does a duplication of the methods really 
> matter or is there a conflict if we do?

Yes. It should be possible to provide PUT without providing all of WebDAV.

Then again, as a practical matter, we will end up providing WebDAV and
PUT is just a subset. In the short term, however, I want PUT and I don't
want to have to implement all of WebDAV just to get PUT.

 > Should WebDAV run on the same port as
> BrowserHTTP?

For content editing, probably. You definately want to be able to
support PUT on the same port.

 > If not, we do the same as we did for XML-RPC and just create a
> WebDAVPublisher that is derived from HTTPPublisher.

But we do want PUT on the same port.

> Oh, at this point I remember how Shane and I planned all this out! I was 
> right, we should have another type of HTTPPublisher, called WebDAVPublisher, 
> which does all the right things. Then you can create either a server that 
> starts the WebDAV service on a seperate port

This isn't what you want for content editing. It's not what you want
when using Amaya or Composer to edit content pages.

 > or you write a RequestFactory
> that knows how to correctly decide between BrowserHTTP or WebDAVHTTP.

You can't distinguish Browser GETs from WebDAV, Amaya, or Composer GETs.
You can't distinguish WebDAV PUTs from Amaya, or Composer PUTs.

 > Note
> that this way you could also merge XML-RPC onto the same port, if you wish.

XML-RPC is a little easier because you have other clues.

> Back in March Shane and I punted on writing more complex server components, 
> since it was too much work... But I would ask him for details, as he had the 
> vision on all of this. ;-)

I'll ask him.

Thanks.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org