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

Shane Hathaway shane@zope.com
Wed, 08 Jan 2003 11:10:16 -0500


Jim Fulton wrote:
> Stephan Richter wrote:
> 
>> On Tuesday 07 January 2003 14:41, Jim Fulton wrote:
>>> 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.

To reinforce this point: you certainly don't want to force people 
implement both WebDAV and DeltaV in the same component, even though 
DeltaV is an extension of WebDAV, and we might want to support DeltaV at 
some point.  As hard as it is to implement WebDAV correctly, DeltaV is a 
little harder.

>>
>>
>>> - 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.

Note that PUT doesn't necessarily imply WebDAV--it's part of the HTTP 
spec.  So you're justified in wanting to implement PUT without 
implementing WebDAV.

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

That's actually a reason why you'd want to run WebDAV on a different 
port from normal HTTP, isn't it?

In special cases, you *can* distinguish WebDAV from browser GETs (using 
user-agent sniffing, IP address sniffing, special URLs, or custom 
headers), so it should be possible, but not required, to accept WebDAV 
and browser requests on the same port.

Shane