<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!--<!DOCTYPE rfc SYSTEM "rfc2629.dtd">-->
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc-ext authors-section="end" ?>
<?rfc-ext sec-no-trailing-dots="yes" ?>

<rfc xmlns:x='http://purl.org/net/xml2rfc/ext' xmlns:ed="http://greenbytes.de/2002/rfcedit" ipr="full3978" docName="draft-reschke-http-addmember-latest" ed:entered-by="julian.reschke@greenbytes.de">
  <x:link rel="Start" href="http://greenbytes.de/tech/webdav/#draft-reschke-http-addmember"/>
  <x:link rel="Alternate" title="(latest)" href="http://greenbytes.de/tech/webdav/draft-reschke-http-addmember-latest.html"/>
	<front>
    <title>The HTTP ADDMEMBER Method</title>

    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
      <organization abbrev="greenbytes">greenbytes GmbH</organization>
      <address>
        <postal>
          <street>Hafenweg 16</street>
          <city>Muenster</city><region>NW</region><code>48155</code>
          <country>Germany</country>
        </postal>
        <phone>+49 251 2807760</phone>	
        <facsimile>+49 251 2807761</facsimile>	
        <email>julian.reschke@greenbytes.de</email>	
        <uri>http://greenbytes.de/tech/webdav/</uri>	
      </address>
    </author>
  
    <date month="October" year="2005"/>
  
    <abstract>
      <t>
        Frequently, servers may want to allow resource creation through HTTP, but
        are not able to support HTTP's PUT method for creating new
        resources, as resource names are completely controlled by the 
        server.  This document proposes a new HTTP method called
        "ADDMEMBER" with semantics similar to those of PUT, except for the fact
        that the server chooses the URI for the newly created resource. 
      </t>
    </abstract>
    
    <note title="Editorial Note">
      <t>
        Distribution of this document is unlimited. Please send comments to the 
        Hypertext Transfer Protocol (HTTP) mailing list at <eref target="mailto:ietf-http-wg@w3.org">ietf-http-wg@w3.org</eref>, which may be joined by sending a message with subject 
        "subscribe" to <eref target="mailto:ietf-http-wg-request@w3.org?subject=subscribe">ietf-http-wg-request@w3.org</eref>.
      </t>
      <t>
        Discussions of the HTTP working group are archived at
        <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.               
      </t> 
    </note>

  </front>

	<middle>



<section title="Introduction">
<t>
  Frequently, servers may want to allow resource creation through HTTP, but
  are not able to support HTTP's PUT method for creating new
  resources, as resource names are completely controlled by the 
  server (see <xref target="RFC2616"/>, Section 9.6).  This document proposes a new HTTP method called
  "ADDMEMBER" with semantics similar to those of PUT, except for the fact
  that the server chooses the URI for the newly created resource. 
</t>
<t>
  Some alternative approaches are summarized in <xref target="alternatives"/>
  for discussion.
</t>
</section>

<section title="Notational Conventions">
<t>
	The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 
	"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 
	document are to be interpreted as described in <xref target="RFC2119"/>.
</t>
<t>
  All terminology not defined explicitly in this document is inherited
  from <xref target="RFC2616"/>.
</t>
</section>

<section title="ADDMEMBER method">
<t>
  The ADDMEMBER method requests that the enclosed entity be stored as a new
  resource under a URI selected by the server based on the Request-URI referring
  to a container resource.  <cref source="reschke">Do we need to require a specific containment
  model here, such as WebDAV's collections?</cref>
</t>
<t>
  If a new resource is created, the origin server MUST inform the user agent via
  the 201 (Created) response, including a "Location" response header containing
  the URI of the newly created resource.  If the resource could not be created, an appropriate
  error response SHOULD be given that reflects the nature of the problem.  The
  recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range)
  headers that it does not understand or implement and MUST return a 501 (Not
  Implemented) response in such cases.
</t>
<t>
  Responses to this method are not cacheable.
</t>
<t>
  The fundamental difference between the ADDMEMBER and PUT requests is reflected
  in the different meaning of the Request-URI.  The URI in an ADDMEMBER request
  identifies the resource that will handle the enclosed entity by storing
  it as a new resource with a server-selected URI.  In contrast, the URI in a
  PUT request identifies the entity enclosed with the request -- the user agent
  knows what URI is intended and the server MUST NOT attempt to apply the request
  to some other resource.
</t>
<t>
  ADDMEMBER requests MUST obey the message transmission requirements set out in Section 8.2 of <xref target="RFC2616"/>.
</t>
<t>
  Entity-headers in the ADDMEMBER request SHOULD be handled the same way
  as defined for PUT.
</t>
<t>
  This method is neither safe nor idempotent (see <xref target="RFC2616"/>, Section 9).
</t>

<section title="Example: ADDMEMBER">
<figure><preamble>
&gt;&gt; Request:
</preamble><artwork>
ADDMEMBER /CollY HTTP/1.1
Host: www.example.com
Content-Type: application/xml

&lt;foobar/>
</artwork></figure>
<figure><preamble>
&gt;&gt; Response:
</preamble><artwork>
HTTP/1.1 201 Created
Location: http://www.example.com/CollY/3253623
</artwork></figure>
</section>

</section>

<section title="Feature Discovery">
<t>
  Clients can detect server support for the ADDMEMBER method by
  inspecting the "Allow" response header returned for an OPTIONS request
  on the Request-URI.  Note that a server may support ADDMEMBER only
  on a subset of the URIs it is handling. 
</t>
</section>

<section title="Security Considerations" anchor="security.considerations">
<t>
  The same security considerations as those for HTTP PUT apply.
</t>
</section>

<section title="Acknowledgements" anchor="acknowledgments">
<t>
  <cref source="reschke">TBD.</cref>
</t>
</section>


    </middle>

	<back>


<references title="Normative References">
	
<reference anchor="RFC2119">
  <front>
    <title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
    <author initials="S." surname="Bradner" fullname="Scott Bradner">
      <organization>Harvard University</organization>
      <address><email>sob@harvard.edu</email></address>
    </author>
    <date month="March" year="1997"/>
    <area>General</area>
    <keyword>keyword</keyword>
  </front>
  <seriesInfo name="BCP" value="14"/>
  <seriesInfo name="RFC" value="2119"/>
</reference>

<reference anchor="RFC2616">
  <front>
    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
    <author initials="R." surname="Fielding" fullname="R. Fielding">
      <organization>University of California, Irvine</organization>
      <address><email>fielding@ics.uci.edu</email></address>
    </author>
    <author initials="J." surname="Gettys" fullname="J. Gettys">
      <organization>W3C</organization>
      <address><email>jg@w3.org</email></address>
    </author>
    <author initials="J." surname="Mogul" fullname="J. Mogul">
      <organization>Compaq Computer Corporation</organization>
      <address><email>mogul@wrl.dec.com</email></address>
    </author>
    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
      <organization>MIT Laboratory for Computer Science</organization>
      <address><email>frystyk@w3.org</email></address>
    </author>
    <author initials="L." surname="Masinter" fullname="L. Masinter">
      <organization>Xerox Corporation</organization>
      <address><email>masinter@parc.xerox.com</email></address>
    </author>
    <author initials="P." surname="Leach" fullname="P. Leach">
      <organization>Microsoft Corporation</organization>
      <address><email>paulle@microsoft.com</email></address>
    </author>
    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
      <organization>W3C</organization>
      <address><email>timbl@w3.org</email></address>
    </author>
    <date month="June" year="1999"/>
  </front>
  <seriesInfo name="RFC" value="2616"/>
</reference>

</references>

<references title="Informative References">

  <reference anchor="RFC2774">
    <front>
      <title>An HTTP Extension Framework</title>
      <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
        <organization abbrev="Microsoft">Microsoft Corporation</organization>
        <address>
          <postal>
            <street>1 Microsoft Way</street>
            <city>Redmond</city><region>WA</region><code>98052</code><country>USA</country>
          </postal>
          <email>frystyk@microsoft.com</email>
        </address>
      </author>
      <author initials="P." surname="Leach" fullname="Paul J. Leach">
        <organization abbrev="Microsoft">Microsoft Corporation</organization>
        <address>
          <postal>
            <street>1 Microsoft Way</street>
            <city>Redmond</city><region>WA</region><code>98052</code><country>USA</country>
          </postal>
          <email>paulle@microsoft.com</email>
        </address>
      </author>
      <author initials="S." surname="Lawrence" fullname="Scott Lawrence">
        <organization abbrev="Agranat Systems">Agranat Systems, Inc.</organization>
        <address>
          <postal>
            <street>5 Clocktower Place, Suite 400</street>
            <city>Maynard</city><region>MA</region><code>01754</code><country>USA</country>
          </postal>
          <email>lawrence@agranat.com</email>
        </address>
      </author>
      <date month='February' year='2000'></date>
    </front>
    <seriesInfo name="RFC" value="2774"/>
  </reference>
</references>  

<section title="Dicussion of alternative approaches" anchor="alternatives">
<t>
  This section tries to summarize alternative approaches.
</t>

<section title="POST">
<t>
  POST is a very generic method and therefore can be used to achieve the 
  same result.  However, clients that rely on the very specific processing
  defined for ADDMEMBER would need a reliable way to discover how the
  server is processing POST requests, requiring a new discovery mechanism.
</t>
</section>

<section title="Implicit PUT extensions">
<t>
  Several communities are discussing to simply use PUT in these situations.  The
  server would allocate a new URI and send a "Location" response header with
  the new URI, rather than storing the entity at the Request-URI.  This
  seems to be contrary to the stated HTTP semantics for PUT, but would allow
  existing clients to make use of this functionality (although it's not clear
  how well they would handle the "URI change upon creation" scenario.
</t>
<t>
  Example:
</t>
<figure><preamble>
&gt;&gt; Request:
</preamble><artwork>
PUT /CollY/something HTTP/1.1
Host: www.example.com
If-None-Match: *
Content-Type: application/xml

&lt;foobar/>
</artwork></figure>
<figure><preamble>
&gt;&gt; Response:
</preamble><artwork>
HTTP/1.1 201 Created
Location: http://www.example.com/CollY/3253623
</artwork></figure>
</section>

<section title="Explicit extensions based on RFC2774">
<t>
  The extension mechanism defined in <xref target="RFC2774"/> could be
  used to extend either POST or PUT with the desired semantics.
</t>
<t>
  Example:
</t>
<figure><preamble>
&gt;&gt; Request:
</preamble><artwork>
M-POST /CollY HTTP/1.1
Host: www.example.com
Man: "urn:ietf:id:draft-reschke-http-addmember-00"; ns=00
00-store-enclosed-entity: 
Content-Type: application/xml

&lt;foobar/>
</artwork></figure>
<figure><preamble>
&gt;&gt; Response:
</preamble><artwork>
HTTP/1.1 201 Created
Location: http://www.example.com/CollY/3253623
</artwork></figure>

</section>

</section>    

    </back>
    
    
</rfc>