Protocol Design: new XML elements in the body or new headers?

Many of the new methods being defined for WebDAV versioning have
an XML document as the value of their request and/or response body.
While designing the protocol, I am continually faced with the question:

Should an input parameter to the method be represented as a new XML
element in the request body or as a new request header?  Similarly,
should an output parameter to the method be represented as a new XML
element in the response body or as a new respose header?

In each case, there is backward compatibility, since downlevel clients
would just not generate the header/element, and downlevel servers
would just ignore the unknown header/element.

An argument for the XML element is that the contents of the XML element
can hold a much wider range of data, and can have its structure defined,
at least in a coarse syntactic fashion, with a DTD.

Another argument for the XML element is that you don't have to worry
about proxies stripping off headers they don't recognize.

The only argument I can think of for using a header is that it is
the only technique applicable when the body is being used for some
other purpose (such as GET/PUT).

One possible rule of thumb:

If the request/response body is an XML document, then the request/response
parameters should be specified as XML elements.  Only if the body is not an
XML document should parameters be specified as headers.

Comments?

Cheers,
Geoff

---
Geoffrey M. Clemm
Chief Engineer, Configuration Management Business Unit
Rational Software Corporation
(781) 676-2684   geoffrey.clemm@rational.com   http://www.rational.com

Received on Saturday, 16 January 1999 21:39:25 UTC