W3C home > Mailing lists > Public > w3c-dist-auth@w3.org > January to March 1999

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

From: Geoffrey M. Clemm <gclemm@atria.com>
Date: Sat, 16 Jan 1999 11:56:16 -0500
Message-Id: <9901161656.AA12304@tantalum>
To: w3c-dist-auth@w3.org
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.



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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:01:19 UTC