drr7731 2011-06-21 18:18
浏览 78
已采纳

如何实现类似Facebook的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!

  • 写回答

1条回答 默认 最新

  • doucong1853 2011-06-21 18:20
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥30 求解达问题(有红包)