Welcome Guest, Not a member yet? Register   Sign In
Controller Method file extensions? (.xml or .php)
#10

[eluser]Fenix[/eluser]
[quote author="xwero" date="1240601162"]
Query strings make it difficult for the user to build their custom data request. Isn't
http://mysite.com/api/categories/orderby...=555555555
easier to understand than
http://mysite.com/api/categories.xml?acc...&sort=desc
[/quote]

I think you are contradicting yourself with this one. URLs are hierarchical. It is much easier for the user to see the key-value pairs in the query string. It also eliminates confusion when you get into required vs optional parameters. I also believe you lose site of the actual endpoint you are trying to access if you use your method.

I am not completely abandoning your method however. There are circumstances when appropriate data will be passed before the query string. Example:
api/user/{user name}/items?from_date=123456&to_date=123556&sort=desc

Moreover, this is how many, if not most, REST APIs work.
Digg API
Last.fm API
Flickr API


Messages In This Thread
Controller Method file extensions? (.xml or .php) - by El Forum - 04-23-2009, 10:35 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-23-2009, 09:35 PM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 01:08 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 06:57 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 07:21 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 07:30 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 07:55 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 08:26 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 08:30 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 08:48 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 08:52 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 08:56 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 09:12 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 09:14 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 09:15 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 09:22 AM
Controller Method file extensions? (.xml or .php) - by El Forum - 04-24-2009, 10:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB