good rest crud apis_ws45
TRANSCRIPT
![Page 1: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/1.jpg)
Good REST CRUD APIs
WS45
![Page 2: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/2.jpg)
Woolery, Matthew A Govindu, Madanamohan R
Carstensen,Robert L Bhogireddy, Chandu Karri, Venkatesh
![Page 3: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/3.jpg)
CONTENTS
What is REST? What makes a good REST API? CRUD HTTP METHODS CRUD IN REST CRUD at User Interface Level Summary Resources
![Page 4: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/4.jpg)
What is REST?• REST == “REpresentational State Transfer”• It is an architectural style for designing
distributed systems, an approach to communication that is often used in the development of web services.
• The use of REST is often preferred over the more heavyweight SOAP.
• REST permits different data formats such as JSON,XML,HTML etc.
• Resource-based• Representations
![Page 5: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/5.jpg)
Web
Ser
ver
HTTP POST URL 3PO(HTML/XML)
HTTP GET request URL 1
HTTP responseURL to submitted PO
PartsList
PartData
PO
HTTP responseResponse(HTML/XML doc)
HTTP responseResponse(HTML/XML doc)
HTTP GET request URL 2
5Reference from RESTANDSOAP_WS63
![Page 6: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/6.jpg)
Resource-based
• Things vs, actions• Nouns vs. verbs• Resources are identified by URIs
RepresentationsExample:• Resource: Student• Service: Student information• Representation: Student name, GPA,
Student major, address, contact number.
![Page 7: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/7.jpg)
What makes a good REST API?The REST architectural style describes 6 constraints:
1. Uniform interface2. Stateless3. Client-server4. Cacheable5. Layered system6. Code on demand
• Following all these constraints means service is strictly RESTful.• Violating anyone of these will not give strict RESTful service
![Page 8: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/8.jpg)
![Page 9: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/9.jpg)
CRUD The acronym CRUD refers to all of the
major functions that are implemented in relational database applications. Each letter in the acronym can map to a standard SQL statement, HTTP method (this is typically used to build RESTful APIs)
![Page 10: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/10.jpg)
Operation SQL HTTP DDS
Create INSERT PUT / POST write
Read (Retrieve) SELECT GET read / take
Update (Modify) UPDATE POST / PUT/ PATCH write
Delete (Destroy) DELETE DELETE dispose
CRUD Operation HTTP MethodCreate POSTRead GETUpdate PUT and/or PATCHDelete DELETE
![Page 11: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/11.jpg)
HTTP METHODS – CRUD IN REST
• Both PUT and POST can create resources; the key difference is that POST leaves it for the server to decide at what URI to make the new resource available.
• PUT dictates what URI to use; The significant point about PUT is that it will replace whatever resource the URI was previously referring to with a brand new version, hence the PUT method being listed for Update as well.
CRUD Operation HTTP MethodCreate POST
Read GET
Update PUT and/or PATCH
Delete DELETE
![Page 12: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/12.jpg)
http://image.slidesharecdn.com/rest-presentation-121213012311-phpapp02/95/rest-presentation-9-638.jpg?cb=1355361849
![Page 13: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/13.jpg)
CRUD at User Interface level• CRUD is also relevant at the user interface level of most applications.• For example consider your phonebook. The software of phonebook must
allow the user to:
a) Create or add new entriesb) Read, retrieve, search, or view existing entriesc) Update or edit existing entriesd) Delete/deactivate/remove existing entries
• Without at least these four operations, the software cannot be considered complete.
![Page 14: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/14.jpg)
SUMMARY:
• Violating any constraint other than Code on Demand means service is not strictly RESTful
• Many HTTP services model CRUD operations through REST or REST-like APIs .
• With all the four CRUD operations, an application is said to be complete.
![Page 15: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/15.jpg)
Resources:http://softwareengineering.stackexchange.com/questions/120716/difference-between-rest-and-crud
https://en.wikipedia.org/wiki/Create,_read,_update_and_delete
http://51elliot.blogspot.com/2014/04/rest-api-best-practices-http-and-crud.html
http://www.restapitutorial.com/
![Page 16: Good REST CRUD APIs_WS45](https://reader036.vdocument.in/reader036/viewer/2022082211/5886c6701a28abcc7d8b6367/html5/thumbnails/16.jpg)
Sai Venkat Poorna Chandu Bhogireddy Govindu, Madanamohan R
Karri Venkatesh Carstensen,Robert L Woolery,Matthew A