Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
This document provides guidance on designing RESTful APIs. It recommends using nouns instead of verbs, keeping URLs simple with only two endpoints per resource, and following conventions from leading APIs. Complex variations and optional parameters should be "swept behind the '?'." The document emphasizes designing for application developers by making APIs intuitive, consistent and complete while
以ä¸ã¯Nick Suttereræ°ã2010å¹´10æ28æ¥ã«èªèº«ã®ããã°ã«æ稿ããã"Rails Misapprehensions: CRUD is not REST! "ã®ç¿»è¨³ã§ããæ¬äººã®è¨±å¯ãå¾ã¦æ²è¼ãã¾ãã Rails Misapprehensions: CRUD is not REST! http://nicksda.apotomo.de/2010/10/rails-misapprehensions-crud-is-not-rest/ Railsã¨RESTã«ã¤ãã¦èª¿ã¹ã¦ããéãäºã¤ã®ãã¨ãããããã£ãã Railsã§RESTãã©ããªã£ã¦ããã®ããä»ã¨æ¯ã¹ã¦ãæ解ã§ãåºç¤çã§ããå°å·ãããã解説ãè¦ã¤ãã«ãããæ°åã®ã¹ã¯ãªã¼ã³ãã£ã¹ããè¦ã¦ãããããã®ç´ æ´ãããã¬ã¤ããä¸ã¤ããã ãã ã£ãã ã¿ããªCRUDã¨RESTãæ··åãã¦ãã ã¨ãããå¾è ã¯åãå°ããããããããã¼ã ãã³ã¼ãããã¨
http://d.hatena.ne.jp/r7kamura/20110505/1304577667ãããããªã¨æã£ã¦ãroutes.rbã®æ¸ãæ¹ã®ä¾ã«ã¤ãã¦ã³ã¡ã³ãããã®ã§ãããèªåã§æ¸ãã¦ããã¦å¾ã§ãunfavoriteãã¯ã¡ãã£ã¨ã¾ããããªã¨æã£ãã®ã§ãfavoriteï¼ãããããæ°ã«å ¥ããã¹ã¿ã¼ï¼ã¯ã©ããããµãã«è¨è¨ããã°ããã®ãèãã¦ã¿ã¾ããã æ§é ã¯ããããæãã®ã tweet has_many favorites user has_many favorites ä»»æã®ãã¤ã¼ãã«ä»»æã®ã¦ã¼ã¶ã¼ããæ°ã«å ¥ããã¤ããããã¨ãããã®ãå¥ã«ãã¤ã¼ããããªãã¦ãä½ã§ãOKã§ãã ããã°ã®ã³ã¡ã³ãã«ã¯ãã®ããã«æ¸ãã¾ããã (1) resources :tweets do member do post 'favorite' post 'unfavorite' end end ã«ã¼ãã£ã³ã°ã¯
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}