<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: POST vs. PUT</title>
	<atom:link href="http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/</link>
	<description>Ranting and Raving</description>
	<lastBuildDate>Thu, 18 Mar 2010 19:01:40 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mark</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-862315</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 26 Jan 2010 12:37:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-862315</guid>
		<description>If you have to use the analogy:

PUT = REPLACE (http://dev.mysql.com/doc/refman/5.0/en/replace.html)

POST = CALL (stored procedures)</description>
		<content:encoded><![CDATA[<p>If you have to use the analogy:</p>
<p>PUT = REPLACE (<a href="http://dev.mysql.com/doc/refman/5.0/en/replace.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/replace.html</a>)</p>
<p>POST = CALL (stored procedures)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PUT or POST: The REST of the Story &#171; Open Sourcery</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-555370</link>
		<dc:creator>PUT or POST: The REST of the Story &#171; Open Sourcery</dc:creator>
		<pubDate>Thu, 16 Oct 2008 22:51:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-555370</guid>
		<description>[...] POST vs. PUT [...]</description>
		<content:encoded><![CDATA[<p>[...] POST vs. PUT [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliotte Rusty Harold</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-553027</link>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
		<pubDate>Mon, 13 Oct 2008 13:14:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-553027</guid>
		<description>Your understanding of HTTP is understandable but incorrect. AtomPub is correct.

PUT is update or create with a user-supplied URL. POST is create with a server generated URL. There are no custom actions at all. That is one of the key principles of REST. Resolving an incident, reopeningt a ticket, etc. are all defined as one of four actions (PUT, POST, GET, DELETE) on a resource. For instance to reopen a ticket, you might PUT the text &quot;true&quot; to http://www.example.com/tickets/42389349/opened.</description>
		<content:encoded><![CDATA[<p>Your understanding of HTTP is understandable but incorrect. AtomPub is correct.</p>
<p>PUT is update or create with a user-supplied URL. POST is create with a server generated URL. There are no custom actions at all. That is one of the key principles of REST. Resolving an incident, reopeningt a ticket, etc. are all defined as one of four actions (PUT, POST, GET, DELETE) on a resource. For instance to reopen a ticket, you might PUT the text &#8220;true&#8221; to <a href="http://www.example.com/tickets/42389349/opened" rel="nofollow">http://www.example.com/tickets/42389349/opened</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Woo</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-552745</link>
		<dc:creator>Daniel Woo</dc:creator>
		<pubDate>Mon, 13 Oct 2008 09:44:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-552745</guid>
		<description>Our understanding of HTTP methods for generic Restful web service:
PUT --&gt; create or update (idempotent)
POST --&gt; custom actions (like resolve incident, reopen a ticket, activate a workflow etc)
DELETE --&gt; delete
GET --&gt; read (safe, idempotent)
HEAD --&gt; existence (safe, optional)
  
But Atom Publishing Protocol use POST for creation:
PUT --&gt; update
POST --&gt; create
DELETE --&gt; delete
GET -- &gt; read
 
Why PUT for Update while POST for creation?
PUT is create or update in HTTP specification, so it’s best to follow HTTP specification, however Atom uses a different strategy here.
I think the reason why Atom Publish Protocol uses POST for entry creation is because in most cases this will return a new ID. While this kind of creation is not appropriate for PUT, since PUT must use the record ID at the end of the URL, eg /rest/person/2012, when the ID is an auto-increment ID at the service end, you can not use PUT to create a record. For POST, the URI would be /rest/person and the service end has the knowledge to generate an ID let’s say 2013 and put the new record’s resource URI “/rest/person/2013” in the response header “location”. This exactly follows HTTP spec.
 
But for those entities you can specify a PK or ID when creating them, and there is no pre-conditions to create them, surely PUT is a better way.</description>
		<content:encoded><![CDATA[<p>Our understanding of HTTP methods for generic Restful web service:<br />
PUT &#8211;&gt; create or update (idempotent)<br />
POST &#8211;&gt; custom actions (like resolve incident, reopen a ticket, activate a workflow etc)<br />
DELETE &#8211;&gt; delete<br />
GET &#8211;&gt; read (safe, idempotent)<br />
HEAD &#8211;&gt; existence (safe, optional)<br />
  <br />
But Atom Publishing Protocol use POST for creation:<br />
PUT &#8211;&gt; update<br />
POST &#8211;&gt; create<br />
DELETE &#8211;&gt; delete<br />
GET &#8212; &gt; read<br />
 <br />
Why PUT for Update while POST for creation?<br />
PUT is create or update in HTTP specification, so it’s best to follow HTTP specification, however Atom uses a different strategy here.<br />
I think the reason why Atom Publish Protocol uses POST for entry creation is because in most cases this will return a new ID. While this kind of creation is not appropriate for PUT, since PUT must use the record ID at the end of the URL, eg /rest/person/2012, when the ID is an auto-increment ID at the service end, you can not use PUT to create a record. For POST, the URI would be /rest/person and the service end has the knowledge to generate an ID let’s say 2013 and put the new record’s resource URI “/rest/person/2013” in the response header “location”. This exactly follows HTTP spec.<br />
 <br />
But for those entities you can specify a PK or ID when creating them, and there is no pre-conditions to create them, surely PUT is a better way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Crisp - Ruby on Rails, C#, .NET, book reviews, film reviews, mind hacks, Wing Chun and the occasional personal bit. &#187; Practical JRuby on Rails (Web 2.0 Projects) by Ola Bini</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-208899</link>
		<dc:creator>James Crisp - Ruby on Rails, C#, .NET, book reviews, film reviews, mind hacks, Wing Chun and the occasional personal bit. &#187; Practical JRuby on Rails (Web 2.0 Projects) by Ola Bini</dc:creator>
		<pubDate>Sun, 16 Dec 2007 04:36:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-208899</guid>
		<description>[...] REST is only mentioned briefly in a little sidebar, and the description of REST as CRUD is a bit misleading, especially when considering POST vs PUT. [...]</description>
		<content:encoded><![CDATA[<p>[...] REST is only mentioned briefly in a little sidebar, and the description of REST as CRUD is a bit misleading, especially when considering POST vs PUT. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pingala</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-96314</link>
		<dc:creator>Pingala</dc:creator>
		<pubDate>Tue, 10 Jul 2007 18:45:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-96314</guid>
		<description>I think these methods (from any Requester to any server/service) have to be consistant across broad in order to be operable as expected in a transcational conversation. That is the protocol syntax. Hence, the server/service components and the request components should implement in the same way what RFC 2616 spelled out:

The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions: 

      - Annotation of existing resources;
      - Posting a message to a bulletin board, newsgroup, mailing list,
        or similar group of articles;
      - Providing a block of data, such as the result of submitting a
        form, to a data-handling process;
      - Extending a database through an append operation.
The actual function performed by the POST method is determined by the server and is usually dependent on the Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a database. 

The action performed by the POST method might not result in a resource that can be identified by a URI. In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the response includes an entity that describes the result.</description>
		<content:encoded><![CDATA[<p>I think these methods (from any Requester to any server/service) have to be consistant across broad in order to be operable as expected in a transcational conversation. That is the protocol syntax. Hence, the server/service components and the request components should implement in the same way what RFC 2616 spelled out:</p>
<p>The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions: </p>
<p>      &#8211; Annotation of existing resources;<br />
      &#8211; Posting a message to a bulletin board, newsgroup, mailing list,<br />
        or similar group of articles;<br />
      &#8211; Providing a block of data, such as the result of submitting a<br />
        form, to a data-handling process;<br />
      &#8211; Extending a database through an append operation.<br />
The actual function performed by the POST method is determined by the server and is usually dependent on the Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a database. </p>
<p>The action performed by the POST method might not result in a resource that can be identified by a URI. In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the response includes an entity that describes the result.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cbmeeks</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-76988</link>
		<dc:creator>cbmeeks</dc:creator>
		<pubDate>Fri, 25 May 2007 11:57:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-76988</guid>
		<description>Great article!  I&#039;ve never really understood why use PUT or why use POST.  To me, they &quot;seemed&quot; to do the same thing.  But your explanation made it simple.  Also makes me understand why Amazon&#039;s S3 uses PUT instead of POST.  Because if you upload a file, and upload it again, it doesn&#039;t duplicate...it wipes the first one out and replaces.  Makes sense.

cbmeeks
http://www.signaldev.com</description>
		<content:encoded><![CDATA[<p>Great article!  I&#8217;ve never really understood why use PUT or why use POST.  To me, they &#8220;seemed&#8221; to do the same thing.  But your explanation made it simple.  Also makes me understand why Amazon&#8217;s S3 uses PUT instead of POST.  Because if you upload a file, and upload it again, it doesn&#8217;t duplicate&#8230;it wipes the first one out and replaces.  Makes sense.</p>
<p>cbmeeks<br />
<a href="http://www.signaldev.com" rel="nofollow">http://www.signaldev.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-63695</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 23 Apr 2007 00:42:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-63695</guid>
		<description>Thank You</description>
		<content:encoded><![CDATA[<p>Thank You</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pauldwaite</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-57821</link>
		<dc:creator>pauldwaite</dc:creator>
		<pubDate>Fri, 30 Mar 2007 23:39:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-57821</guid>
		<description>Wonderfully explained. Thank you.</description>
		<content:encoded><![CDATA[<p>Wonderfully explained. Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: License 2 Code &#187; PUT vs POST - Confusion Abounds</title>
		<link>http://www.elharo.com/blog/software-development/web-development/2005/12/08/post-vs-put/comment-page-1/#comment-18946</link>
		<dc:creator>License 2 Code &#187; PUT vs POST - Confusion Abounds</dc:creator>
		<pubDate>Sat, 04 Nov 2006 18:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elharo.com/blog/?p=46#comment-18946</guid>
		<description>[...] In my research on REST this last week, I&#8217;ve seen several comments noting confusion on whether to use PUT or POST. After reading several references (Elliotte Rusty Harold, Sacrificial Rabbit, and Mark Baker) , I will attempt to paraphrase the rule as: [...]</description>
		<content:encoded><![CDATA[<p>[...] In my research on REST this last week, I&#8217;ve seen several comments noting confusion on whether to use PUT or POST. After reading several references (Elliotte Rusty Harold, Sacrificial Rabbit, and Mark Baker) , I will attempt to paraphrase the rule as: [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
