<?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: Introduction to writing a REST server in PHP</title>
	<atom:link href="http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/</link>
	<description>Beautiful Web Applications</description>
	<lastBuildDate>Thu, 18 Mar 2010 23:16:52 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ersin</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-24105</link>
		<dc:creator>Ersin</dc:creator>
		<pubDate>Mon, 17 Aug 2009 06:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-24105</guid>
		<description>i did a package look at http://develturk.com/2009/08/17/easyrest-rest-framework-10-released-client-and-server-library/</description>
		<content:encoded><![CDATA[<p>i did a package look at <a href="http://develturk.com/2009/08/17/easyrest-rest-framework-10-released-client-and-server-library/" rel="nofollow">http://develturk.com/2009/08/17/easyrest-rest-framework-10-released-client-and-server-library/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-3431</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 28 Jan 2009 23:30:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-3431</guid>
		<description>Great stuff Michael-- clearest info I&#039;ve found on the issue.
If you get a chance, I&#039;d like to hear from you on the importance of the structure of the REST (eg. why have a single class for the services rather than having a meaningful directory structure with the functions broken out by directory).

I&#039;d love to see the class you&#039;re writing when that&#039;s done, too

Thanks</description>
		<content:encoded><![CDATA[<p>Great stuff Michael&#8211; clearest info I&#8217;ve found on the issue.<br />
If you get a chance, I&#8217;d like to hear from you on the importance of the structure of the REST (eg. why have a single class for the services rather than having a meaningful directory structure with the functions broken out by directory).</p>
<p>I&#8217;d love to see the class you&#8217;re writing when that&#8217;s done, too</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Using Yahoo!&#8217;s Term Extractor API &#124; Fliquid Studios</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-2955</link>
		<dc:creator>Using Yahoo!&#8217;s Term Extractor API &#124; Fliquid Studios</dc:creator>
		<pubDate>Tue, 27 Jan 2009 03:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-2955</guid>
		<description>[...] Introduction to writing a REST server in PHP  [...]</description>
		<content:encoded><![CDATA[<p>[...] Introduction to writing a REST server in PHP  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Little</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-862</link>
		<dc:creator>Michael Little</dc:creator>
		<pubDate>Thu, 15 Jan 2009 12:20:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-862</guid>
		<description>Hi Graham,

Thanks for your comments.

I&#039;m not sure I quite understand what your getting at exactly. At the point where the 404 is returned it is entirely possible that the resource, particularly for the specified request URI does not exist. Depending on how the URL rewriting is set up /not-a-valid-url might be rewritten to the script above but that does mean it exists in the RESTmap array which ultimately is responsible for determining what requests are valid.

If in the example above a GET request was sent to the /my-delete URI I agree that a 405 should be returned. Due to the simplicity of my example and the lack of granularity in error checking it simply doesn&#039;t allow for it. A real world situation would obviously be much more complex and would make such considerations.</description>
		<content:encoded><![CDATA[<p>Hi Graham,</p>
<p>Thanks for your comments.</p>
<p>I&#8217;m not sure I quite understand what your getting at exactly. At the point where the 404 is returned it is entirely possible that the resource, particularly for the specified request URI does not exist. Depending on how the URL rewriting is set up /not-a-valid-url might be rewritten to the script above but that does mean it exists in the RESTmap array which ultimately is responsible for determining what requests are valid.</p>
<p>If in the example above a GET request was sent to the /my-delete URI I agree that a 405 should be returned. Due to the simplicity of my example and the lack of granularity in error checking it simply doesn&#8217;t allow for it. A real world situation would obviously be much more complex and would make such considerations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kuba</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-751</link>
		<dc:creator>Kuba</dc:creator>
		<pubDate>Wed, 14 Jan 2009 21:58:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-751</guid>
		<description>You can also check REST in Zend Framework.</description>
		<content:encoded><![CDATA[<p>You can also check REST in Zend Framework.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loïc Hoguin</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-748</link>
		<dc:creator>Loïc Hoguin</dc:creator>
		<pubDate>Wed, 14 Jan 2009 21:44:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-748</guid>
		<description>Yes I might have been a bit too far but that&#039;s how far my understanding of REST goes (I look forward for more articles btw). According to the wikipedia link you gave, REST defines resources represented by a URL which can be accessed using different HTTP methods to do different actions. Having a different URL per action didn&#039;t seem very &quot;RESTful&quot;. Good that it&#039;s cleared up.

Oh and you might want to correct the &quot;200 Not Found&quot; that should be &quot;404 Not Found&quot; in your example, sorry for not having been more comprehensible about that earlier.</description>
		<content:encoded><![CDATA[<p>Yes I might have been a bit too far but that&#8217;s how far my understanding of REST goes (I look forward for more articles btw). According to the wikipedia link you gave, REST defines resources represented by a URL which can be accessed using different HTTP methods to do different actions. Having a different URL per action didn&#8217;t seem very &#8220;RESTful&#8221;. Good that it&#8217;s cleared up.</p>
<p>Oh and you might want to correct the &#8220;200 Not Found&#8221; that should be &#8220;404 Not Found&#8221; in your example, sorry for not having been more comprehensible about that earlier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham Cebulskie</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-691</link>
		<dc:creator>Graham Cebulskie</dc:creator>
		<pubDate>Wed, 14 Jan 2009 14:02:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-691</guid>
		<description>The &quot;200 Not Found&quot; which you meant to be 404 is not appropriate at that point in the code.  A 404 indicates the resource is not found, but the resource exists; you just wrote it.  It should be &quot;405 Method Not Allowed&quot; and must be accompanied by an Allow header indicating which methods are supported.  In the case above, what you need is:
header(&#039;HTTP/1.x 405 Method Not Allowed&#039;);
header(&#039;Allow: GET, PUT, POST, DELETE&#039;);
// print 405 page here
exit;</description>
		<content:encoded><![CDATA[<p>The &#8220;200 Not Found&#8221; which you meant to be 404 is not appropriate at that point in the code.  A 404 indicates the resource is not found, but the resource exists; you just wrote it.  It should be &#8220;405 Method Not Allowed&#8221; and must be accompanied by an Allow header indicating which methods are supported.  In the case above, what you need is:<br />
header(&#8217;HTTP/1.x 405 Method Not Allowed&#8217;);<br />
header(&#8217;Allow: GET, PUT, POST, DELETE&#8217;);<br />
// print 405 page here<br />
exit;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Little</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-682</link>
		<dc:creator>Michael Little</dc:creator>
		<pubDate>Wed, 14 Jan 2009 13:04:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-682</guid>
		<description>Loïc, 

Thanks for your feedback.

I had intentionally used different URLs to show the mapping of the different URLs to the functions. Although I wouldn&#039;t go so far as to say it is &quot;the point of REST to have resources like http://example.org/mystuff and to be able to use all 4 methods&quot; you do make a very valid point.

As such, I have updated my post so I have updated my post so the my-post URL will now map to the my_post and my_put functions depending on the request method. The same thing could of course be done with the GET and DELETE methods.</description>
		<content:encoded><![CDATA[<p>Loïc, </p>
<p>Thanks for your feedback.</p>
<p>I had intentionally used different URLs to show the mapping of the different URLs to the functions. Although I wouldn&#8217;t go so far as to say it is &#8220;the point of REST to have resources like <a href="http://example.org/mystuff" rel="nofollow">http://example.org/mystuff</a> and to be able to use all 4 methods&#8221; you do make a very valid point.</p>
<p>As such, I have updated my post so I have updated my post so the my-post URL will now map to the my_post and my_put functions depending on the request method. The same thing could of course be done with the GET and DELETE methods.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-01-13 &#171; Bloggitation</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-631</link>
		<dc:creator>links for 2009-01-13 &#171; Bloggitation</dc:creator>
		<pubDate>Wed, 14 Jan 2009 07:01:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-631</guid>
		<description>[...] Introduction to writing a REST server in PHP (tags: programming php rest web2.0) [...]</description>
		<content:encoded><![CDATA[<p>[...] Introduction to writing a REST server in PHP (tags: programming php rest web2.0) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loïc Hoguin</title>
		<link>http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/comment-page-1/#comment-498</link>
		<dc:creator>Loïc Hoguin</dc:creator>
		<pubDate>Tue, 13 Jan 2009 14:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.fliquidstudios.com/?p=140#comment-498</guid>
		<description>200 Not Found -&gt; 404

I&#039;m not sure if you mentioned it but isn&#039;t the point of REST to have resources like http://example.org/mystuff and to be able to use all 4 methods (GET/POST/PUT/DELETE) on that unique resource? Your example shows an URL per method instead of a unique URL that can be accessed using all 4 methods. That&#039;s kinda misleading.</description>
		<content:encoded><![CDATA[<p>200 Not Found -&gt; 404</p>
<p>I&#8217;m not sure if you mentioned it but isn&#8217;t the point of REST to have resources like <a href="http://example.org/mystuff" rel="nofollow">http://example.org/mystuff</a> and to be able to use all 4 methods (GET/POST/PUT/DELETE) on that unique resource? Your example shows an URL per method instead of a unique URL that can be accessed using all 4 methods. That&#8217;s kinda misleading.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
