<?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: Putting semi-RESTful API development to&#8230; rest</title>
	<atom:link href="http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/feed/" rel="self" type="application/rss+xml" />
	<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 09:32:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: teknoid</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-11503</link>
		<dc:creator>teknoid</dc:creator>
		<pubDate>Mon, 23 May 2011 15:21:39 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-11503</guid>
		<description>@Stephen

It might have something to do with HTTP headers and content type. 
I think if you send your request as &quot;text/plain&quot;, it won&#039;t be POST&#039;ed properly.

There&#039;s a simple firefox add-on called &quot;poster&quot;, which can help set the correct headers/content type and further troubleshoot the problem</description>
		<content:encoded><![CDATA[<p>@Stephen</p>
<p>It might have something to do with HTTP headers and content type.<br />
I think if you send your request as &#8220;text/plain&#8221;, it won&#8217;t be POST&#8217;ed properly.</p>
<p>There&#8217;s a simple firefox add-on called &#8220;poster&#8221;, which can help set the correct headers/content type and further troubleshoot the problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-11495</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Thu, 19 May 2011 20:24:33 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-11495</guid>
		<description>This works fine for me except that my api_info() action will not accept post vars, I&#039;ve tried all sorts! var_dump(file_get_contents(&#039;php://input&#039;)) will receive the Request Body but nothing will transfer the Request Headers into $_POST variables. Know any reason why this may happen? Thanks in advance</description>
		<content:encoded><![CDATA[<p>This works fine for me except that my api_info() action will not accept post vars, I&#8217;ve tried all sorts! var_dump(file_get_contents(&#8216;php://input&#8217;)) will receive the Request Body but nothing will transfer the Request Headers into $_POST variables. Know any reason why this may happen? Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teknoid</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-10416</link>
		<dc:creator>teknoid</dc:creator>
		<pubDate>Tue, 27 Jul 2010 18:02:21 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-10416</guid>
		<description>@red

Thanks, I&#039;ll give it a shot to see if it works for me now as well.</description>
		<content:encoded><![CDATA[<p>@red</p>
<p>Thanks, I&#8217;ll give it a shot to see if it works for me now as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: red</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-10414</link>
		<dc:creator>red</dc:creator>
		<pubDate>Tue, 27 Jul 2010 16:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-10414</guid>
		<description>Ops, looks like comments are not escaped :) I mean insted of:

Better is:
echo $this-&gt;Xml-&gt;header();</description>
		<content:encoded><![CDATA[<p>Ops, looks like comments are not escaped :) I mean insted of:</p>
<p>Better is:<br />
echo $this-&gt;Xml-&gt;header();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: red</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-10413</link>
		<dc:creator>red</dc:creator>
		<pubDate>Tue, 27 Jul 2010 16:14:37 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-10413</guid>
		<description>Regarding the not-cake-way header(&quot;content-type: text/xml&quot;) I&#039;ve found that putting in controller:
$this-&gt;RequestHandler-&gt;respondAs(&#039;xml&#039;);
$this-&gt;RequestHandler-&gt;setContent(&#039;xml&#039;, &#039;text/xml&#039;);

Works perfect, no need to set up header in view anymore.

Oh, and instead of:
echo &#039;&#039;;

I think better is:
Xml-&gt;header(); ?&gt;</description>
		<content:encoded><![CDATA[<p>Regarding the not-cake-way header(&#8220;content-type: text/xml&#8221;) I&#8217;ve found that putting in controller:<br />
$this-&gt;RequestHandler-&gt;respondAs(&#8216;xml&#8217;);<br />
$this-&gt;RequestHandler-&gt;setContent(&#8216;xml&#8217;, &#8216;text/xml&#8217;);</p>
<p>Works perfect, no need to set up header in view anymore.</p>
<p>Oh, and instead of:<br />
echo &#8221;;</p>
<p>I think better is:<br />
Xml-&gt;header(); ?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teknoid</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-10278</link>
		<dc:creator>teknoid</dc:creator>
		<pubDate>Tue, 29 Jun 2010 14:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-10278</guid>
		<description>@kvz

Thanks, that&#039;s great. I&#039;ll give it a shot once I come back around to this part of the project.</description>
		<content:encoded><![CDATA[<p>@kvz</p>
<p>Thanks, that&#8217;s great. I&#8217;ll give it a shot once I come back around to this part of the project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kvz</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-10277</link>
		<dc:creator>kvz</dc:creator>
		<pubDate>Tue, 29 Jun 2010 12:44:49 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-10277</guid>
		<description>Hey teknoid,

FYI, I&#039;ve developed a plugin for Cake that does this &amp; some more:
http://github.com/kvz/cakephp-rest-plugin</description>
		<content:encoded><![CDATA[<p>Hey teknoid,</p>
<p>FYI, I&#8217;ve developed a plugin for Cake that does this &#038; some more:<br />
<a href="http://github.com/kvz/cakephp-rest-plugin">http://github.com/kvz/cakephp-rest-plugin</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teknoid</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-10276</link>
		<dc:creator>teknoid</dc:creator>
		<pubDate>Mon, 28 Jun 2010 18:36:14 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-10276</guid>
		<description>@Mandy

These are very good questions, and would supplement the article very well... but I wanted to stay on point.
That being said, there a few common solutions for the authentication.

1. IP restriction on the server side, basically if you have the IP(s) of the requesting server (such as a partner site), this is probably the &quot;safest&quot; way to control access... however it should be done in your firewall or server config.
2. Issue a token...
a. The user must first request an authorization.
b. You issue a token (some random string) which must be supplied with any following request... again combining this with something like a hashed IP + username would make the access even more secure.
c. This token would persist for a limited amount of time. Such scheme is used by many API&#039;s including popular credit card gateways and your favorite sites like PayPal :)
3. You could agree with the third party on a specific public/private key combo and only allow access based on the fact that the both requirements are met.

The one point that&#039;s a bit harder to control is the amount of hits to the API, again, IMO, this should not be handled on the application level, but rather at the server/firewall settings.</description>
		<content:encoded><![CDATA[<p>@Mandy</p>
<p>These are very good questions, and would supplement the article very well&#8230; but I wanted to stay on point.<br />
That being said, there a few common solutions for the authentication.</p>
<p>1. IP restriction on the server side, basically if you have the IP(s) of the requesting server (such as a partner site), this is probably the &#8220;safest&#8221; way to control access&#8230; however it should be done in your firewall or server config.<br />
2. Issue a token&#8230;<br />
a. The user must first request an authorization.<br />
b. You issue a token (some random string) which must be supplied with any following request&#8230; again combining this with something like a hashed IP + username would make the access even more secure.<br />
c. This token would persist for a limited amount of time. Such scheme is used by many API&#8217;s including popular credit card gateways and your favorite sites like PayPal :)<br />
3. You could agree with the third party on a specific public/private key combo and only allow access based on the fact that the both requirements are met.</p>
<p>The one point that&#8217;s a bit harder to control is the amount of hits to the API, again, IMO, this should not be handled on the application level, but rather at the server/firewall settings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mandy</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-10275</link>
		<dc:creator>Mandy</dc:creator>
		<pubDate>Mon, 28 Jun 2010 18:19:34 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-10275</guid>
		<description>great article!

however, i would like to know your thoughts on api authentication.

what if the api  user needs to be identified by a api_key and secret ?

is there an easy way to just make sure all api functions are protected by it ?

how can we take care of rate limiting if we are going to get hammered by hits ?

i know some of my questions are beyond the scope of your article but since i was working on an api, i was trying to answers these myself when i read your article :)

-mandy.</description>
		<content:encoded><![CDATA[<p>great article!</p>
<p>however, i would like to know your thoughts on api authentication.</p>
<p>what if the api  user needs to be identified by a api_key and secret ?</p>
<p>is there an easy way to just make sure all api functions are protected by it ?</p>
<p>how can we take care of rate limiting if we are going to get hammered by hits ?</p>
<p>i know some of my questions are beyond the scope of your article but since i was working on an api, i was trying to answers these myself when i read your article :)</p>
<p>-mandy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention Putting semi-RESTful API development to… rest « nuts and bolts of cakephp -- Topsy.com</title>
		<link>http://nuts-and-bolts-of-cakephp.com/2010/06/27/putting-semi-restful-api-development-to-rest/#comment-10274</link>
		<dc:creator>Tweets that mention Putting semi-RESTful API development to… rest « nuts and bolts of cakephp -- Topsy.com</dc:creator>
		<pubDate>Mon, 28 Jun 2010 00:51:58 +0000</pubDate>
		<guid isPermaLink="false">http://teknoid.wordpress.com/?p=997#comment-10274</guid>
		<description>[...] This post was mentioned on Twitter by Dennis James, ber clausen. ber clausen said: RT: @cakephp_dennis: Putting semi-RESTful API development &gt; http://bit.ly/cLmu9M &lt; nice one here :) [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Dennis James, ber clausen. ber clausen said: RT: @cakephp_dennis: Putting semi-RESTful API development > <a href="http://bit.ly/cLmu9M">http://bit.ly/cLmu9M</a> < nice one here :) [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

