<?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"
	>
<channel>
	<title>Comments on: HTTP Status: 201 Created vs. 202 Accepted</title>
	<atom:link href="http://benramsey.com/archives/http-status-201-created-vs-202-accepted/feed/" rel="self" type="application/rss+xml" />
	<link>http://benramsey.com/archives/http-status-201-created-vs-202-accepted/</link>
	<description>PHP and Other Techno-babble</description>
	<pubDate>Sun, 12 Oct 2008 09:55:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Ben Ramsey</title>
		<link>http://benramsey.com/archives/http-status-201-created-vs-202-accepted/#comment-169502</link>
		<dc:creator>Ben Ramsey</dc:creator>
		<pubDate>Fri, 25 Apr 2008 19:43:34 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/http-status-201-created-vs-202-accepted/#comment-169502</guid>
		<description>Glen, I will eventually get around to talking specifically about the verbs themselves, but as a short answer, in the AtomPub service I'm building, we equate the verbs directly to CRUD, as the AtomPub spec recommends:

[code]
POST   --&gt; Create
GET    --&gt; Read
PUT    --&gt; Update
DELETE --&gt; Delete
[/code]

However, I can see how you might PUT a new representation of a "collection" that the server would then interpret to add or remove new items to the collection, creating new resources, removing them, or doing both to different resources in the same action. Likewise, you could use POST directly on a resource to do a partial update, whereas a PUT essentially means "replace" and replaces the representation of a resource with a new one. I treat PUT loosely, though, because I don't want people to be able to change certain values in the Atom Entry representation (i.e. atom:id, atom:published, etc.).

As you can probably tell, I have a lot to say about this, so I'll make a full post on it sometime in the future. :-)</description>
		<content:encoded><![CDATA[<p>Glen, I will eventually get around to talking specifically about the verbs themselves, but as a short answer, in the AtomPub service I&#8217;m building, we equate the verbs directly to CRUD, as the AtomPub spec recommends:</p>
<p>
<div class="hl-surround" ><div class="hl-main"><pre>POST   --&gt; Create
GET    --&gt; Read
PUT    --&gt; Update
DELETE --&gt; Delete</pre></div></div>
</p>
<p>However, I can see how you might PUT a new representation of a &#8220;collection&#8221; that the server would then interpret to add or remove new items to the collection, creating new resources, removing them, or doing both to different resources in the same action. Likewise, you could use POST directly on a resource to do a partial update, whereas a PUT essentially means &#8220;replace&#8221; and replaces the representation of a resource with a new one. I treat PUT loosely, though, because I don&#8217;t want people to be able to change certain values in the Atom Entry representation (i.e. atom:id, atom:published, etc.).</p>
<p>As you can probably tell, I have a lot to say about this, so I&#8217;ll make a full post on it sometime in the future. <img src='http://benramsey.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen Gordon</title>
		<link>http://benramsey.com/archives/http-status-201-created-vs-202-accepted/#comment-169495</link>
		<dc:creator>Glen Gordon</dc:creator>
		<pubDate>Fri, 25 Apr 2008 19:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/http-status-201-created-vs-202-accepted/#comment-169495</guid>
		<description>Hi Ben, great couple of posts so far. I know you might get to the answer to this question eventually, but it bears asking now. You mention "using the 201 Created status code as a response to successful POST requests for creation of new content in the service" in here. What's your perspective on the architecture of services when it comes to these verbs? Some folks say to map the HTTP verbs POST, GET, PUT and DELETE explicitly to each letter in CRUD. Others say to be more lenient and in a sense "overload" the POST verb, letting it sometimes be create, sometimes be update, based on the context of the URI. Plus, I know there are issues where some browsers don't support all of those verbs, which would affect Ajax style apps trying to use XmlHttpRequest. So what say ye?</description>
		<content:encoded><![CDATA[<p>Hi Ben, great couple of posts so far. I know you might get to the answer to this question eventually, but it bears asking now. You mention &#8220;using the 201 Created status code as a response to successful POST requests for creation of new content in the service&#8221; in here. What&#8217;s your perspective on the architecture of services when it comes to these verbs? Some folks say to map the HTTP verbs POST, GET, PUT and DELETE explicitly to each letter in CRUD. Others say to be more lenient and in a sense &#8220;overload&#8221; the POST verb, letting it sometimes be create, sometimes be update, based on the context of the URI. Plus, I know there are issues where some browsers don&#8217;t support all of those verbs, which would affect Ajax style apps trying to use XmlHttpRequest. So what say ye?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Hauenstein</title>
		<link>http://benramsey.com/archives/http-status-201-created-vs-202-accepted/#comment-169487</link>
		<dc:creator>Dave Hauenstein</dc:creator>
		<pubDate>Fri, 25 Apr 2008 18:58:05 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/http-status-201-created-vs-202-accepted/#comment-169487</guid>
		<description>Great post. I just developed a ReSTful API for creating and viewing log buckets and log records. When a log record is posted to a particular bucket, it's not yet written to the database. It's first written to a que (which happens to be a text file) where a daemon will run and process each record. Since the log isn't actually created at that moment, i return a 202 accepted. This implies exactly what you said above: it has not been created because there is some further processing to perform, but it was successfully received by the server.</description>
		<content:encoded><![CDATA[<p>Great post. I just developed a ReSTful API for creating and viewing log buckets and log records. When a log record is posted to a particular bucket, it&#8217;s not yet written to the database. It&#8217;s first written to a que (which happens to be a text file) where a daemon will run and process each record. Since the log isn&#8217;t actually created at that moment, i return a 202 accepted. This implies exactly what you said above: it has not been created because there is some further processing to perform, but it was successfully received by the server.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
