REST URI Merli Lall.

Slides:



Advertisements
Similar presentations
Pierre-Johan CHARTRE Java EE - JAX-RS - Pierre-Johan CHARTRE
Advertisements

REST - Representational State Transfer
Representational State Transfer (REST): Representing Information in Web 2.0 Applications this is the presentation Emilio F Zegarra CS 2650.
Building and using REST information services Rion Dooley.
Introduction to Web Services
Server Access The REST of the Story David Cleary
REST (Representational State Transfer)
CS 4720 RESTfulness CS 4720 – Web & Mobile Systems.
4.01 How Web Pages Work.
#spsevents #spsphx SPS EVENTS PHX Know REST for the Query AN INTRODUCTION TO REST FOR SHAREPOINT 2013 ERIC J OSZAKIEWSKI, MCTS, MS, MCPS.
HTTP By: Becky Fultz, Joe Flager, Katie Huston, Tom Packard, Allison Wilsey.
Topics in this presentation: The Web and how it works Difference between Web pages and web sites Web browsers and Web servers HTML purpose and structure.
Creating your website Using Plain HTML. What is HTML? ► Web pages are authored in HyperText Markup Language (HTML) ► Plain text is marked up with tags,
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
RESTful Web Development With Nodejs and Express. REST Stands for REpresentational State Transfer Has the following constraints: ◦Client-Server ◦Stateless.
Web Architecture & Services (2) Representational State Transfer (REST)
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
Wyatt Pearsall November  HyperText Transfer Protocol.
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
Open Data Protocol * Han Wang 11/30/2012 *
REST - Introduction Based on material from InfoQ.com (Stefan Tilkov) And slides from MindTouch.com (Steve Bjorg) 1.
Copyright © Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Drupal Web Services 1 Authored by: Chaitanya Anil Kulkarni Presented.
RESTful Web Service 2014 년 12 월 한연희
PV247 – Development I Introduction to ASP.NET and related technologies.
1 Web Servers (Chapter 21 – Pages( ) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture.
API Crash Course CWU Startup Club. OUTLINE What is an API? Why are API’s useful? What is HTTP? JSON? XML? What is a RESTful API? How do we consume an.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
Advanced Web Technologies Lecture #4 By: Faraz Ahmed.
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
RESTful Web Services What is RESTful?
RESTful Web Services A MIDAS MISSION PRESENTATION APRIL 29, 2015.
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
REST API Design. Application API API = Application Programming Interface APIs expose functionality of an application or service that exists independently.
National College of Science & Information Technology.
4.01 How Web Pages Work.
Brice Copy, Mirjam Labrenz
Jason Bury Dylan Drake Rush Corey Watt
The Client-Server Model
API (Application Program Interface)
Better RESTFul API – Best Practices
WEB SERVICES.
REST: Web Services Abel Sanchez.
REST- Representational State Transfer Enn Õunapuu
Contents Digital-SNOWTAM Trial Introduction REST Introduction
Introduction To Web Design
Unit – 5 JAVA Web Services
An introduction to REST for SharePoint 2013
E-commerce | WWW World Wide Web - Concepts
Advanced Web-based Systems | Misbhauddin
E-commerce | WWW World Wide Web - Concepts
Web Design Introduction to the Internet Week One
Applied Cyber Infrastructure Concepts Fall 2017
Ashish Pandit IT Architect, Middleware & Integration Services
Introduction to Web Services and SOA
WEB API.
$, $$, $$$ API testing Edition
Introduction to Web Services
Web Server Design Week 16 Old Dominion University
Web services introduction, application and its future
A gentle introduction to RESTful APIs
REST APIs Maxwell Furman Department of MIS Fox School of Business
Python and REST Kevin Hibma.
Introduction to Web Services and SOA
Web APIs In computer programming, an application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application.
Week 05 Node.js Week 05
4.01 How Web Pages Work.
A gentle introduction to RESTful APIs
REST API Design Borrowed heavily from:
Presentation transcript:

REST URI Merli Lall

REST – Representational State Transfer Is the software architectural style for building web applications and services. The client passes to the server anything that server needs to perform the action - the server returns to the client with action complete. Server doesn’t remember anything about the client. REST provides a definition of a resource (URI). Uses HTTP protocol verbs. Requires specific media types as response (like XML or JSON).

Instead of directory structure and a specific file in the specific folder: http://example.com/UpdateEmployee.aspx In RESTful service the URI represents data : http://example.com/Employee/Edit/12345

HTTP methods GET - Requests data from a specified resource POST - Submits data to be processed to a specified resource PUT – Updates data Create, Retrieve, Update, Delete becomes POST, GET, PUT, and DELETE

URI? URL?? URN??? Uniform Resource Identificator has two specializations known as URL and URN. URI : locator, a name, or both. URL : locator. URN: historical name for URI or a unique resource name. URIs identify and URLs locate; however, locators are also identifiers, so every URL is also a URI, but there are URIs which are not URLs.

URI URI - Is a resource locator, a name, or both. Resource - every interesting piece of information the server can provide

Resource examples: Users of the system. Courses in which a student is enrolled. A user's timeline of posts. The users that follow another user. An article about what ever. Each resource = at least one URI identifying it.

Important notes! RESTful APIs are written for consumers. The name and structure of URIs should convey meaning to those consumers.  Design for your clients, not for your data.

URIs should be written: All in the same way (Predictable structure) In a way that data has structure/relationships (Hierarchical structure) Why? To increase understandability and usability. Example: GET http://www.example.com/customers/33245/orders/8769/lineitems/1

Important notes!  RESTful URI should refer to a resource that is an object instead of referring to an action.  So you should…. Name your resources as nouns! Don’t name them as verbs or actions! Nouns have properties/attributes as verbs do not.

Good examples Don’t use verbs: /getAllCars /createNewCar /deleteAllRedCars Use PUT, POST and DELETE methods  instead of the GET method to alter the state.

Noun names? Do not mix up singular and plural nouns. Keep it simple and use only plural nouns for all resources. /cars instead of /car /users instead of /user /products instead of /product /settings instead of /setting Pluralization of resource names in REST URIs is the widely adopted standard followed by the overwhelming majority of public and private APIs.

Maybe one exception.. It's acceptable to use a singularized resource name when there can only be one of the resource—it's a singleton resource. GET|PUT|DELETE http://www.example.com/configuration GET|PUT|DELETE http://www.example.com/customers/12345/configuration

Kokkuvõtteks: REST URI võiks olla: - Intuitiivne ehk üheselt mõistetav ja sama stiili. - Hierarhiline ehk omab struktuuri ja seotust - Ilma tegusõnadeta - Resursside nimed mitmuses GET http://www.example.com/customers/33245/orders/8769/lineitems/1

Tänan kuulamast!

Kasutatud lingid http://www.looah.com/source/view/2284 https://developer.github.com/v3/ http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for- better-restful-api/ http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful- api#restful http://www.restapitutorial.com/lessons/restfulresourcenaming.html https://www.youtube.com/watch?v=LHJk_ISxHHc