TechTalk#3: REST

16
RestFul Aleksey Pakholkov [email protected]

description

Share our experience working with RESTful architecture. By Alexey Pakholkov Read more about this and other techtalks in DA-14's blog: http://da-14.com/our-blog/

Transcript of TechTalk#3: REST

Page 1: TechTalk#3: REST

RestFulAleksey Pakholkov

[email protected]

Page 2: TechTalk#3: REST

API1. SOAP

2. XML-RPC

3. REST

Page 3: TechTalk#3: REST

RestFul?

Не, не слышал...

Page 4: TechTalk#3: REST

Roy FieldingRoy Thomas Fielding (born 1965) is an

American computer scientist, one of the principal

authors of the HTTPspecification, an authority on

computer network architecture and co-founder of

the Apache HTTP Server project.

Page 5: TechTalk#3: REST

Why REST?● Scalability● Generality● Independence● Caching● Security● Stateless● Format(HTML, XML, JSON)

Page 6: TechTalk#3: REST

Richardson Maturity ModelLevel 0Level 1 - ResourcesLevel 2 - HTTP VerbsLevel 3 - Hypermedia Controls

Page 7: TechTalk#3: REST

Level 0 HTTP to tunnel RPC

Page 8: TechTalk#3: REST

Level 1: Resources

Page 9: TechTalk#3: REST

Level 2: HTTP verbs

Page 10: TechTalk#3: REST

Level 3: Hypermedia controls

Page 11: TechTalk#3: REST

HTTP Method● GET● POST● PUT● PATCH● DELETE● api/resource[/:id]

Page 12: TechTalk#3: REST

Hypertext Application Language{ "_links": { "self": { "href": "http://bc1.loc/api/v1/users/1/buildings/1/messages" } },

"_embedded": { "messages": [

{

"id": 128,

"subject": "Test Create 16-10",

"_embedded": {

"lastPost": {

"id": 51,

"body": "12312123",

...................

},

"_links": {

"self": {

"href": "http://bc1.loc/api/v1/users/1/messages/128/posts/51"

}

}

},

...........................

Page 13: TechTalk#3: REST

Example

Page 14: TechTalk#3: REST

….Cloud● AbstractRestfulController

● PhlyRestfully

● CustomRestfully

Page 15: TechTalk#3: REST

Problems● Authentication● ???

Page 16: TechTalk#3: REST

Questions