开发者

how to implement a facebook-like api?

i am going to be coding an api, and after playing around with the facebook api, i really like how they do things, especially with the url scheme they use.

for instance, with facebook you can do something like:

http://graph.facebook.com/me/friends

or something like it to get a JSON object of the friends of the user profile.

i know how to so something like that using query strings and whatnot, such as:

http://api.mysite.com/users.php?userid=...&feed=friends

does anyone here know how i can implement something similar to the facebook api with their url scheme? i really like how it flows (almost has a jQuery-like chainability effect to it).

i 开发者_开发百科looked up the "mod_alias" module to apache, but couldn't determine if that is what i need...

thanks!


Facebook is following a RESTful architecture pattern. I recommend you start your research on the same architecture. Here's the wikipedia article as a definition.

Representational State Transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. The term Representational State Transfer was introduced and defined in 2000 by Roy Fielding in his doctoral dissertation. Fielding is one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification versions 1.0 and 1.1.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜