Thanks Christoph and Siddharth for prompt reply. <br><br>But I have a different cocern. For either format, all the requests from client will be handled by one script. I went throgh Christoph&#39;s article: <meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://baudson.cute-ice.de/serendipity/index.php?/archives/20-RESTful-Web-Service-with-PHP-2.html">http://baudson.cute-ice.de/serendipity/index.php?/archives/20-RESTful-Web-Service-with-PHP-2.html</a><br>
<br>Here, Christoph is parsing the URL to identify the resource. So this means that all the URLs are being handled by the same script. I can explain it in verbose. <br><br>Client sends: GET api/user/id/json<br>Now in general apache server will try to open a page api/user/id/json/index.html or execute the file api/user/id/json.php <br>
But we know this is wrong. Actually, there will be a script say api/index.php which will parse the URL api/user/id/json and find the resource and format.<br><br>So, one way to solve this problem is to map all the urls of the form api/* to api/index.php. This can be done by using mod rewrite. <br>
Any other solution? Do I make sense? Normally I don&#39;t :-)<br><br>Regards<br>Vikas<br><br><div class="gmail_quote">On Sun, Jul 11, 2010 at 1:04 PM, Siddharth Prakash Singh <span dir="ltr">&lt;<a href="mailto:spsneo@gmail.com">spsneo@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Christoph,<br>
<br>
Twitter uses the format like GET user/id.json or GET user/id.xml<br>
<br>
Siddharth<br>
<div><div></div><div class="h5"><br>
On Sun, Jul 11, 2010 at 12:54 PM, Christoph Baudson<br>
&lt;<a href="mailto:christoph@baudson.de">christoph@baudson.de</a>&gt; wrote:<br>
&gt; -----BEGIN PGP SIGNED MESSAGE-----<br>
&gt; Hash: SHA1<br>
&gt;<br>
&gt; Hi Vikas,<br>
&gt;<br>
&gt; Vikas Banjara wrote:<br>
&gt;&gt; Hi all,<br>
&gt;&gt;<br>
&gt;&gt; I want a discussion on ways of handling REST API Request. Rest request URL<br>
&gt;&gt; will be like -<br>
&gt;&gt; GET api/user/id.json or Get api/user/id.xml<br>
&gt;&gt; Now all the requests are handled by one page say api/index.php. So how are<br>
&gt;&gt; we going to redirect all such request to this index.php.<br>
&gt;&gt; One solution could be Apache rewrite.<br>
&gt;&gt;<br>
&gt;&gt; Is it a good solution? Is it a standard solution? Any other better solution?<br>
&gt;<br>
&gt; I had studied a book [1] on RESTful Web Services with PHP last year. The<br>
&gt; authors used the following style of representing resources<br>
&gt;<br>
&gt; api/user.php/&lt;id&gt;/json<br>
&gt;<br>
&gt; Not sure if this is the standard way, but I think it&#39;s easier to start<br>
&gt; without rewrite rules (more people will join and test).<br>
&gt;<br>
&gt; Read more about it at my blog [2].<br>
&gt;<br>
&gt; Comments?<br>
&gt;<br>
&gt; Christoph<br>
&gt;<br>
&gt; [1] <a href="http://www.packtpub.com/restful-php-web-services/book" target="_blank">http://www.packtpub.com/restful-php-web-services/book</a><br>
&gt; [2]<br>
&gt; <a href="http://baudson.cute-ice.de/serendipity/index.php?/archives/19-RESTful-Web-Service-with-PHP-1.html" target="_blank">http://baudson.cute-ice.de/serendipity/index.php?/archives/19-RESTful-Web-Service-with-PHP-1.html</a><br>

&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks<br>
&gt;&gt; Vikas<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------------------------------------------------<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Mapbender_dev mailing list<br>
&gt;&gt; <a href="mailto:Mapbender_dev@lists.osgeo.org">Mapbender_dev@lists.osgeo.org</a><br>
&gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapbender_dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapbender_dev</a><br>
&gt;<br>
&gt; -----BEGIN PGP SIGNATURE-----<br>
&gt; Version: GnuPG v1.4.9 (GNU/Linux)<br>
&gt; Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br>
&gt;<br>
&gt; iEYEARECAAYFAkw5cZUACgkQGtMIfbycMX41oACgkY315VrU8pWggW8Ft/xiXosZ<br>
&gt; sLcAoNMnFgYenHuD6kp6T1vqOqVoLPea<br>
&gt; =yKaL<br>
&gt; -----END PGP SIGNATURE-----<br>
&gt; _______________________________________________<br>
&gt; Mapbender_dev mailing list<br>
&gt; <a href="mailto:Mapbender_dev@lists.osgeo.org">Mapbender_dev@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapbender_dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapbender_dev</a><br>
&gt;<br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Siddharth Prakash Singh<br>
<a href="http://www.spsneo.com" target="_blank">http://www.spsneo.com</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Mapbender_dev mailing list<br>
<a href="mailto:Mapbender_dev@lists.osgeo.org">Mapbender_dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapbender_dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapbender_dev</a><br>
</div></div></blockquote></div><br>