際際滷

際際滷Share a Scribd company logo
于亞亠仆亳亶 仂仂
e.dorosh
REPRESENTATIONAL STATE TRANSFER
RoyThomas Fielding
http://www.ics.uci.edu/~鍖elding/pubs/dissertation/
鍖elding_dissertation.pdf
REST is an architectural style for distributed
hypermedia systems.
REST provides a set of architectural constraints that, when
applied as a whole, emphasizes scalability of component
interactions, generality of interfaces, independent deployment of
components, and intermediary components to reduce interaction
latency, enforce security, and encapsulate legacy systems.
REST is de鍖ned by 4 interface constraints:
* identi鍖cation of resources;
* manipulation of resources through representations;
* self- descriptive messages;
* hypermedia as the engine of application state
RICHARDSON MATURITY MODEL
http://martinfowler.com/articles/richardsonMaturityModel.html
丕 0,1,2
* 仗亳舒仆亳亠 亠仂于
* 仍亳亠仆 亳仗仂仍亰亠 仂仗亠亟亠仍亠仆仆亠 HTTP 亞仍舒亞仂仍
* 弌亠于亠 仂于亠舒亠 HTTP Statue Codes
* Content Negotiation
丕亂 3
* 弍仆舒亢亠仆亳亠 亠于亳仂于 亠亠亰 仂仆仂亠仆亳
* 亳仗亠亠从仂于亠 仂仄舒 (html, HAL, JSON-LD )
* 亠 仆亠 于舒亢仆, 于舒亢仆 亳 仗亠亟舒于仍亠仆亳
* URI 仆亠 于舒亢亠仆, 于舒亢亠仆 URI 舒弍仍仂仆
* 仗 从仍亳亠仆舒 从仍ム亠于仂亶
* 弌亠仄舒仆亳从舒 仗亳仍仂亢亠仆亳 亳 仗仂仂从仂仍舒
HATEOAS
Hypertext As The Engine Of Application State
亅仂 仂亰仆舒舒亠, 仂 亞亳仗亠仄亠亟亳舒 亟仂仍亢仆仂 弍 亳仗仂仍亰仂于舒仆仂,
亟仍 仂弍仆舒亢亠仆亳 仂仗亠亟亠仍亠仆仆仂亞仂 仗亳 仗仂 API. 亅仂 于磶舒仆仂 
仗亠亠仂亟舒仄亳 仗仂 仂仂礌亳.
亳仍仂亢亠仆亳亠 - 仂 弍仂仍舒 仄舒亳仆舒 仂仂礌亳亶
http://timelessrepo.com/haters-gonna-hateoas
弌丕弌  弌丐
 亠 仄仂亢亠 亠仄 亞仂亟仆仂 亳 仄仂亢亠 亳仄亠
弍仂仍亠亠 仂亟仆仂亞仂 仗亠亟舒于仍亠仆亳.
亠亟舒于仍亠仆亳亠 仂仗亳于舒亠 仂仂礌亳亠
亠舒.
弌丐 丐
 舒从亳仄 仗仂于亠亟亠仆亳亠仄 舒舒从亠亳亰亠 舒仄舒亳于舒亠仄亶
亠 于 舒仄从舒 HTTP (Query Params, HTTPVerb)?
弌丐 亊
 丼仂 从仂仆从亠仆仂 仗仂亳亰仂亶亟亠  仂仂礌亳亠仄 仗亳仍仂亢亠仆亳
亳仍亳 亠舒? 丼仂 仆舒 仗仂亟舒 仆舒 于仂亟 / 仂 仗仂仍亳仄 仆舒
于仂亟亠?
个
弌仗仂仂弍 仂仗亳舒仆亳亠 亠仄舒仆亳从亳 仗亳仍仂亢亠仆亳, 从仂仂亶
仆亠 仄亠仆磳 亠仄舒仆亳从 仗亠亟舒于仍亠仆亳 亠舒, 仆仂
仗仂亰于仂仍磳 从仍亳亠仆舒仄 亰仆舒于舒 弍仂仍亠 仂
亟仂仗仂仍仆亳亠仍仆仂亶 亠仄舒仆亳从亳.
乘:
HAL/Siren JSON-LD JSON-SchemaAPI Docs
RESTful API (ru/en)
丼丐 丐丕丐  丐?
https://dev.twitter.com/rest/reference/post/statuses/destroy/id
 弌丐丐亂
RESTFUL API?
丕丐丶亊
SWAGGER API
API BLUEPRINT
MOCKING API:APIARY
SYMFONY/PHP
 NelmioApiDocBundle (+ 从仂仆于亠舒亳 于 Swagger)
 Jane (JSON-Schema) and Jane Open Api
丶亊
 Symfony REST Edition = 仂仂亳亶 HTTP++ API
 API Platform (JSON-LD+Hydra)
 Fractlal, Negotiation
API PLATFORM
JSON-LD
JSON-LD
JSON-LD + HYDRA
JSON API
丐弌丐
PHPUnit Behat
Node.js / Chakram Node.js / Frisby
Apiary/Dredd
Postman HTTPie jq: like sed for JSON data
弌仗舒亳弍仂 亰舒 于仆亳仄舒仆亳亠!
e.dorosh

More Related Content

RESTful API (ru/en)

  • 2. REPRESENTATIONAL STATE TRANSFER RoyThomas Fielding http://www.ics.uci.edu/~鍖elding/pubs/dissertation/ 鍖elding_dissertation.pdf
  • 3. REST is an architectural style for distributed hypermedia systems. REST provides a set of architectural constraints that, when applied as a whole, emphasizes scalability of component interactions, generality of interfaces, independent deployment of components, and intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems. REST is de鍖ned by 4 interface constraints: * identi鍖cation of resources; * manipulation of resources through representations; * self- descriptive messages; * hypermedia as the engine of application state
  • 5. 丕 0,1,2 * 仗亳舒仆亳亠 亠仂于 * 仍亳亠仆 亳仗仂仍亰亠 仂仗亠亟亠仍亠仆仆亠 HTTP 亞仍舒亞仂仍 * 弌亠于亠 仂于亠舒亠 HTTP Statue Codes * Content Negotiation
  • 6. 丕亂 3 * 弍仆舒亢亠仆亳亠 亠于亳仂于 亠亠亰 仂仆仂亠仆亳 * 亳仗亠亠从仂于亠 仂仄舒 (html, HAL, JSON-LD ) * 亠 仆亠 于舒亢仆, 于舒亢仆 亳 仗亠亟舒于仍亠仆亳 * URI 仆亠 于舒亢亠仆, 于舒亢亠仆 URI 舒弍仍仂仆 * 仗 从仍亳亠仆舒 从仍ム亠于仂亶 * 弌亠仄舒仆亳从舒 仗亳仍仂亢亠仆亳 亳 仗仂仂从仂仍舒
  • 7. HATEOAS Hypertext As The Engine Of Application State 亅仂 仂亰仆舒舒亠, 仂 亞亳仗亠仄亠亟亳舒 亟仂仍亢仆仂 弍 亳仗仂仍亰仂于舒仆仂, 亟仍 仂弍仆舒亢亠仆亳 仂仗亠亟亠仍亠仆仆仂亞仂 仗亳 仗仂 API. 亅仂 于磶舒仆仂 仗亠亠仂亟舒仄亳 仗仂 仂仂礌亳. 亳仍仂亢亠仆亳亠 - 仂 弍仂仍舒 仄舒亳仆舒 仂仂礌亳亶 http://timelessrepo.com/haters-gonna-hateoas
  • 8. 弌丕弌 弌丐 亠 仄仂亢亠 亠仄 亞仂亟仆仂 亳 仄仂亢亠 亳仄亠 弍仂仍亠亠 仂亟仆仂亞仂 仗亠亟舒于仍亠仆亳. 亠亟舒于仍亠仆亳亠 仂仗亳于舒亠 仂仂礌亳亠 亠舒.
  • 9. 弌丐 丐 舒从亳仄 仗仂于亠亟亠仆亳亠仄 舒舒从亠亳亰亠 舒仄舒亳于舒亠仄亶 亠 于 舒仄从舒 HTTP (Query Params, HTTPVerb)? 弌丐 亊 丼仂 从仂仆从亠仆仂 仗仂亳亰仂亶亟亠 仂仂礌亳亠仄 仗亳仍仂亢亠仆亳 亳仍亳 亠舒? 丼仂 仆舒 仗仂亟舒 仆舒 于仂亟 / 仂 仗仂仍亳仄 仆舒 于仂亟亠?
  • 10. 个 弌仗仂仂弍 仂仗亳舒仆亳亠 亠仄舒仆亳从亳 仗亳仍仂亢亠仆亳, 从仂仂亶 仆亠 仄亠仆磳 亠仄舒仆亳从 仗亠亟舒于仍亠仆亳 亠舒, 仆仂 仗仂亰于仂仍磳 从仍亳亠仆舒仄 亰仆舒于舒 弍仂仍亠 仂 亟仂仗仂仍仆亳亠仍仆仂亶 亠仄舒仆亳从亳. 乘: HAL/Siren JSON-LD JSON-SchemaAPI Docs
  • 12. 丼丐 丐丕丐 丐? https://dev.twitter.com/rest/reference/post/statuses/destroy/id
  • 18. SYMFONY/PHP NelmioApiDocBundle (+ 从仂仆于亠舒亳 于 Swagger) Jane (JSON-Schema) and Jane Open Api
  • 19. 丶亊 Symfony REST Edition = 仂仂亳亶 HTTP++ API API Platform (JSON-LD+Hydra) Fractlal, Negotiation
  • 25. 丐弌丐 PHPUnit Behat Node.js / Chakram Node.js / Frisby Apiary/Dredd Postman HTTPie jq: like sed for JSON data