SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
Dr. Sabin Buraga – www.purl.org/net/busaco
Python “sinners” must
R⚗ST
warning:
some sensitive people might consider
this presentation somewhat offensive
in this situation, these persons are advised
to immediately abandon all humour
and better visit gore Websites for the real-life “fun”
Thank you for understanding!
100% pure sarcasm & irony included
So, our Web application
must provide certain
functionalities* to be
consumed by software
(not only by humans)…
* desired data requested via HTTP
http://www.boredpanda.com/funny-chinese-translation-fails/
…Oh, by the way,
what the Web is?

…Oh, by the way,
what the Web is?
content ≅ sexy <mark-ups/>
+ stylish CSS heartaches
http://www.funnypicss.com/humor/i-know-html/
…Oh, by the way,
what the Web is?
interaction ≅ URI + hypermedia
(HTTP delights?)
http://httpstatusdogs.com/
…Oh, by the way,
what the Web is?
development ≅ client and/or
server-side programming %#^&!
paradigms/languages/frameworks/magic/…
http://stressandanger.wordpress.com/funny-pictures/
In order to satisfy some 〠 needs,
the software must offer certain ☠ services*
http://brog.engrish.com/
* the action of helping or doing work for someone
Web service
a piece of s…oftware providing a s…pecific functionality
http://wallpaperstop.co/wallpapers/2013/07/Cats-Funny-Meme-272x480.jpg
Web service
a piece of s…oftware providing a s…pecific functionality
access to resources of (dis)interest – Instagram, Pinterest, Tumblr
boring news aggregators – Digg, Reddit
(“surreal”) maps – Bing Maps, Google Maps, Nokia HERE
instant mess(ages) – Jabber, Twitter, Twilio
world-wide stupidity – see Facebook (Open Graph Protocol)
(unsecure) data storage – Amazon S3, Dropbox, OneDrive
…and many, many, many others
Web service
developed & deployed by using W3C standards
URI (Unicorn Ridiculous Identifier) – aka Web address
access via HTTP (Hyper Trickiest Triviality Provider)
data formats:
JSON (JavaScript Orgiastic Needs)
XML (Exquisite Manual Labor)
…
Web service
a classical implementation:
using certain Web application servers/frameworks
for Python, some popular choices are
Django, Grok, TurboGears, web2py, Zope
https://wiki.python.org/moin/WebFrameworks
generic architecture of a traditional Web application
(N-tier application)
Client Web application Storage
(user interface) server/framework (data persistence)
Internet
(Web)
Web service
goal: processing the answer (data) provided by a given Web
site/application in order to (re)use it in our (client) programs
http://nedhardy.com/2013/04/22/17-hilarious-ad-placement-fails/
Web service
a naïve solution:
Web scraping
extracting data of interest
by parsing (incorrect)
HTML constructs
www.winhdwallpapers.com/funny/funny-html-code-hd-wallpaper-1080p
Web service
Web scraping
several Python libraries:
Beautiful Soup – www.crummy.com/software/BeautifulSoup/
html5lib-python – https://github.com/html5lib/html5lib-python
lxml – http://lxml.de/
Scrappy – http://scrapy.org/
How about an interesting*
paradigm of Web service
development?
* aka pragmatic
http://commons.wikimedia.org/wiki/File:France_Paris_Notre-Dame-Adam_and_Eve.jpg
REST (REpresentational State Transfer)
Web development focused on
the representation(s) of a resource
Roy Fielding – PhD Thesis (2000)
REST (REpresentational State Transfer)
Web development focused on
the representation(s) of a resource
e.g., user, blog, article,
photo, source-code,…
REST (REpresentational State Transfer)
Web development focused on
the representation(s) of a resource
HTML, PNG, SVG, JSON,…
REST (REpresentational State Transfer)
Web development focused on
the representation(s) of a resource
denoted by MIME types:
text/html, application/json,…
each resource can have multiple representations
accessed via HTTP requests
clients (browsers, robots, players,…) interact
with the resource representations via HTTP verbs:
create: POST, retrieve: GET, update: PUT, delete: DELETE
representation2
(Atom)
resource
URI
URLURL
GET POST GET DELETE
representation1
(HTML)
resource1
representation1
(HTML)
http://blog.info/
http://blog.info/post
http://blog.info/post/edit
http://blog.info/news
GET
resource2
resource3
resource4
GET
POST
representation2
(HTML) representation3
(HTML)
representation4
(Atom)
resource1
representation1
(HTML)
http://blog.info/
http://blog.info/post
http://blog.info/post/edit
http://blog.info/news
GET
resource2
resource3
resource4
GET
POST
representation2
(HTML) representation3
(HTML)
representation4
(Atom)
HATEOAS (Hypermedia As The Engine Of Application State)
So, some practical
advises about building
RESTful Web services?
http://www.funpedia.net/imgs/may11/very-funny-signs-06.jpg
Use nouns for each class of resources
to be managed by your service
User
Document – alternatives: Photo, Product, Software
Metadata – e.g., Comment, Format, Platform, Tag,…
Use nouns for each class of resources
to be managed by your service
collections of “things” (typically, plural)
/snakes
unique identifiers for every member of a collection
/snakes/python versus /snakes/69
SoundCloud API
types of resources:
tracks, users, current user (me),
playlists, groups, comments
http://developers.soundcloud.com/
Name each resource by using URLs
http://www.slideshare.net/busaco/presentations
http://www.imdb.com/title/tt0401383/
http://www.last.fm/music/Moby
http://vimeo.com/channels/731014
Design accepted representations to be sent by
potential clients
+
optional parameters
(useful for pagination, partial responses, filtering,…)
/snakes?limit=3&offset=14
/snakes?fields=name,age,description
Choose the representation(s) of the response
to be sent to client
consider existing standardized data formats
e.g., HTML, Atom, JSON,…
Accept: application/json (Digg)
/venue.json (Foursquare)
http://api.sciencemuseum.org.uk/exhibitions/?output=json
interactive access to the data provided by a public Web service
http://developer.nytimes.com/
JSON response
Integrate resources via URLs + Web forms
Create use cases
specify exception/error conditions
via HTTP status codes + additional information
200 OK, 303 See Other, 400 Bad Request, 404 Not Found,…
http://httpstatus.es/
“Never release an API without a version
and make the version mandatory.”—Brian Mulloy (2012)
http://feeds.delicious.com/v2/{format}/{username}
?v=1.0 (Facebook)
Some (programming)
tools for developers?
http://www.weirdasianews.com/category/engrish/
Python HTTP clients
classical built-in modules:
httplib (Python 2)
http.client (Python 3)
Python HTTP clients
a specific library:
Unirest for Python – http://unirest.io/python.html
Developing RESTful Web services in Python
one of our favorite frameworks:
Bottle, CheeryPy, Django REST, Flask, web.py
using a Python wrapper for
a specific Web service/API:
www.pythonapi.com
Useful Web resources
for learning & making
experiments?
building a REST service:
Learn REST: A RESTful Tutorial
www.restapitutorial.com
Thoughts on RESTful API Design
https://restful-api-design.readthedocs.org
Implementing REST
https://code.google.com/p/implementing-rest/
testing our/others APIs:
Make HTTP Requests
http://www.hurl.it/
HTTP Request & Response
http://httpbin.org/
Apigee Console
https://apigee.com/console/
don’t forget to consult:
ProgrammableWeb
http://www.programmableweb.com/
The Web engineer’s online toolbox
ivanzuzak.info/2012/11/18/the-web-engineers-online-toolbox.html
R⚗ST
(and some Python)
http://photos1.blogger.com/blogger/3043/2944/1600/woman-snake-1280.jpg

Más contenido relacionado

Destacado

Formato 500 cartas jimenez 10a
Formato 500 cartas jimenez 10aFormato 500 cartas jimenez 10a
Formato 500 cartas jimenez 10agmariajimenez
 
Spice world london 2012 Ben Snape
Spice world london 2012 Ben SnapeSpice world london 2012 Ben Snape
Spice world london 2012 Ben SnapeSpiceworks
 
Los conocemos mejor que tu
Los conocemos mejor que tuLos conocemos mejor que tu
Los conocemos mejor que tuDavid Morales
 
Local Commerce – Wird der stationäre Handel wieder eine Chance verpassen?
Local Commerce – Wird der stationäre Handel wieder eine Chance verpassen?Local Commerce – Wird der stationäre Handel wieder eine Chance verpassen?
Local Commerce – Wird der stationäre Handel wieder eine Chance verpassen?Brack.ch
 
CURSO - SEMINARIO: TERTULIAS PEDAGÓGICAS DIALÓGICAS: CONSTRUCCIÓN COLECTIVA D...
CURSO - SEMINARIO: TERTULIAS PEDAGÓGICAS DIALÓGICAS: CONSTRUCCIÓN COLECTIVA D...CURSO - SEMINARIO: TERTULIAS PEDAGÓGICAS DIALÓGICAS: CONSTRUCCIÓN COLECTIVA D...
CURSO - SEMINARIO: TERTULIAS PEDAGÓGICAS DIALÓGICAS: CONSTRUCCIÓN COLECTIVA D...InfantilCantabria
 
Gestion Creativa: I+D+i en Software Libre como transformador económico social
Gestion Creativa: I+D+i en Software Libre como transformador económico socialGestion Creativa: I+D+i en Software Libre como transformador económico social
Gestion Creativa: I+D+i en Software Libre como transformador económico socialGuadalinfo Red Social
 
IANA Update September 2015
IANA Update September 2015IANA Update September 2015
IANA Update September 2015APNIC
 
Colt Access Solution Presentation External 12 07 2011
Colt Access Solution Presentation   External   12 07 2011Colt Access Solution Presentation   External   12 07 2011
Colt Access Solution Presentation External 12 07 2011acaiani
 
Asia Frontier Capital - AFC Vietnam Fund presentation 2015.08.09
Asia Frontier Capital - AFC Vietnam Fund presentation 2015.08.09Asia Frontier Capital - AFC Vietnam Fund presentation 2015.08.09
Asia Frontier Capital - AFC Vietnam Fund presentation 2015.08.09Thomas Hugger
 
Dossier Eventos Corporativos Altacazuela
Dossier Eventos Corporativos AltacazuelaDossier Eventos Corporativos Altacazuela
Dossier Eventos Corporativos AltacazuelaAltacazuela Catering
 

Destacado (16)

BCUR Poster
BCUR PosterBCUR Poster
BCUR Poster
 
Formato 500 cartas jimenez 10a
Formato 500 cartas jimenez 10aFormato 500 cartas jimenez 10a
Formato 500 cartas jimenez 10a
 
Spice world london 2012 Ben Snape
Spice world london 2012 Ben SnapeSpice world london 2012 Ben Snape
Spice world london 2012 Ben Snape
 
Los conocemos mejor que tu
Los conocemos mejor que tuLos conocemos mejor que tu
Los conocemos mejor que tu
 
Local Commerce – Wird der stationäre Handel wieder eine Chance verpassen?
Local Commerce – Wird der stationäre Handel wieder eine Chance verpassen?Local Commerce – Wird der stationäre Handel wieder eine Chance verpassen?
Local Commerce – Wird der stationäre Handel wieder eine Chance verpassen?
 
Cataleg globaldis
Cataleg globaldisCataleg globaldis
Cataleg globaldis
 
Chequeo
ChequeoChequeo
Chequeo
 
CURSO - SEMINARIO: TERTULIAS PEDAGÓGICAS DIALÓGICAS: CONSTRUCCIÓN COLECTIVA D...
CURSO - SEMINARIO: TERTULIAS PEDAGÓGICAS DIALÓGICAS: CONSTRUCCIÓN COLECTIVA D...CURSO - SEMINARIO: TERTULIAS PEDAGÓGICAS DIALÓGICAS: CONSTRUCCIÓN COLECTIVA D...
CURSO - SEMINARIO: TERTULIAS PEDAGÓGICAS DIALÓGICAS: CONSTRUCCIÓN COLECTIVA D...
 
Gestion Creativa: I+D+i en Software Libre como transformador económico social
Gestion Creativa: I+D+i en Software Libre como transformador económico socialGestion Creativa: I+D+i en Software Libre como transformador económico social
Gestion Creativa: I+D+i en Software Libre como transformador económico social
 
IANA Update September 2015
IANA Update September 2015IANA Update September 2015
IANA Update September 2015
 
La electricidad y las corrientes eléctricas
La electricidad y las corrientes eléctricasLa electricidad y las corrientes eléctricas
La electricidad y las corrientes eléctricas
 
gshxfj
gshxfjgshxfj
gshxfj
 
Colt Access Solution Presentation External 12 07 2011
Colt Access Solution Presentation   External   12 07 2011Colt Access Solution Presentation   External   12 07 2011
Colt Access Solution Presentation External 12 07 2011
 
Bulos en internet, cómo detectarlos y cómo actuar?
Bulos en internet, cómo detectarlos y cómo actuar?Bulos en internet, cómo detectarlos y cómo actuar?
Bulos en internet, cómo detectarlos y cómo actuar?
 
Asia Frontier Capital - AFC Vietnam Fund presentation 2015.08.09
Asia Frontier Capital - AFC Vietnam Fund presentation 2015.08.09Asia Frontier Capital - AFC Vietnam Fund presentation 2015.08.09
Asia Frontier Capital - AFC Vietnam Fund presentation 2015.08.09
 
Dossier Eventos Corporativos Altacazuela
Dossier Eventos Corporativos AltacazuelaDossier Eventos Corporativos Altacazuela
Dossier Eventos Corporativos Altacazuela
 

Similar a REST and some Python (or 'Python "sinners" must REST')

Application latency and streaming API
Application latency and streaming APIApplication latency and streaming API
Application latency and streaming APIstreamdata.io
 
Web2.0 2012 - lesson 7 - technologies and mashups
Web2.0 2012 - lesson 7 - technologies and mashups Web2.0 2012 - lesson 7 - technologies and mashups
Web2.0 2012 - lesson 7 - technologies and mashups Carlo Vaccari
 
Experiments in Data Portability 2
Experiments in Data Portability 2Experiments in Data Portability 2
Experiments in Data Portability 2Glenn Jones
 
Web Technology Trends (early 2009)
Web Technology Trends (early 2009)Web Technology Trends (early 2009)
Web Technology Trends (early 2009)Prodosh Banerjee
 
Search Engine Spiders
Search Engine SpidersSearch Engine Spiders
Search Engine SpidersCJ Jenkins
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Pierre Joye
 
Google App Engine: An Introduction
Google App Engine: An IntroductionGoogle App Engine: An Introduction
Google App Engine: An IntroductionAbu Ashraf Masnun
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in DjangoLakshman Prasad
 
Beyond web services: supporting mashup artists at Yahoo!
Beyond web services: supporting mashup artists at Yahoo!Beyond web services: supporting mashup artists at Yahoo!
Beyond web services: supporting mashup artists at Yahoo!Chad Dickerson
 
Fundamentals of web_design_v2
Fundamentals of web_design_v2Fundamentals of web_design_v2
Fundamentals of web_design_v2hussain534
 
Build your own Chrome Extension with AngularJS
Build your own Chrome Extension with AngularJSBuild your own Chrome Extension with AngularJS
Build your own Chrome Extension with AngularJSflrent
 
PhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile HackPhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile HackPhoneGap
 
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkBuilding a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkSt. Petersburg College
 
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013Gustaf Nilsson Kotte
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Jonas Bandi
 
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...cresco
 
2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar SlidesDuraSpace
 

Similar a REST and some Python (or 'Python "sinners" must REST') (20)

Application latency and streaming API
Application latency and streaming APIApplication latency and streaming API
Application latency and streaming API
 
Web2.0 2012 - lesson 7 - technologies and mashups
Web2.0 2012 - lesson 7 - technologies and mashups Web2.0 2012 - lesson 7 - technologies and mashups
Web2.0 2012 - lesson 7 - technologies and mashups
 
Experiments in Data Portability 2
Experiments in Data Portability 2Experiments in Data Portability 2
Experiments in Data Portability 2
 
Web Technology Trends (early 2009)
Web Technology Trends (early 2009)Web Technology Trends (early 2009)
Web Technology Trends (early 2009)
 
Search Engine Spiders
Search Engine SpidersSearch Engine Spiders
Search Engine Spiders
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
 
Google App Engine: An Introduction
Google App Engine: An IntroductionGoogle App Engine: An Introduction
Google App Engine: An Introduction
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
Beyond web services: supporting mashup artists at Yahoo!
Beyond web services: supporting mashup artists at Yahoo!Beyond web services: supporting mashup artists at Yahoo!
Beyond web services: supporting mashup artists at Yahoo!
 
02 intro
02   intro02   intro
02 intro
 
Fundamentals of web_design_v2
Fundamentals of web_design_v2Fundamentals of web_design_v2
Fundamentals of web_design_v2
 
Bug Bounty for - Beginners
Bug Bounty for - BeginnersBug Bounty for - Beginners
Bug Bounty for - Beginners
 
Build your own Chrome Extension with AngularJS
Build your own Chrome Extension with AngularJSBuild your own Chrome Extension with AngularJS
Build your own Chrome Extension with AngularJS
 
PhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile HackPhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile Hack
 
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkBuilding a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
 
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!
 
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
 
2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides
 
REST Presentation
REST PresentationREST Presentation
REST Presentation
 

Más de Sabin Buraga

Web 2020 01/12: World Wide Web – aspecte arhitecturale
Web 2020 01/12: World Wide Web – aspecte arhitecturaleWeb 2020 01/12: World Wide Web – aspecte arhitecturale
Web 2020 01/12: World Wide Web – aspecte arhitecturaleSabin Buraga
 
Web 2020 02/12: Programare Web – HTTP. Cookie-uri. Sesiuni Web
Web 2020 02/12: Programare Web – HTTP. Cookie-uri. Sesiuni WebWeb 2020 02/12: Programare Web – HTTP. Cookie-uri. Sesiuni Web
Web 2020 02/12: Programare Web – HTTP. Cookie-uri. Sesiuni WebSabin Buraga
 
Web 2020 03/12: Programare Web – Arhitectura aplicaţiilor Web. Inginerie Web
Web 2020 03/12: Programare Web – Arhitectura aplicaţiilor Web. Inginerie WebWeb 2020 03/12: Programare Web – Arhitectura aplicaţiilor Web. Inginerie Web
Web 2020 03/12: Programare Web – Arhitectura aplicaţiilor Web. Inginerie WebSabin Buraga
 
Web 2020 04/12: Programare Web – Dezvoltarea aplicaţiilor Web în PHP
Web 2020 04/12: Programare Web – Dezvoltarea aplicaţiilor Web în PHP Web 2020 04/12: Programare Web – Dezvoltarea aplicaţiilor Web în PHP
Web 2020 04/12: Programare Web – Dezvoltarea aplicaţiilor Web în PHP Sabin Buraga
 
Web 2020 05/12: Modelarea datelor. Familia XML. Extragerea datelor cu XPath. ...
Web 2020 05/12: Modelarea datelor. Familia XML. Extragerea datelor cu XPath. ...Web 2020 05/12: Modelarea datelor. Familia XML. Extragerea datelor cu XPath. ...
Web 2020 05/12: Modelarea datelor. Familia XML. Extragerea datelor cu XPath. ...Sabin Buraga
 
Web 2020 06/12: Procesarea datelor XML & HTML. Document Object Model
Web 2020 06/12: Procesarea datelor XML & HTML. Document Object ModelWeb 2020 06/12: Procesarea datelor XML & HTML. Document Object Model
Web 2020 06/12: Procesarea datelor XML & HTML. Document Object ModelSabin Buraga
 
Web 2020 07/12: Procesarea datelor XML & HTML – Simple API for XML. Procesări...
Web 2020 07/12: Procesarea datelor XML & HTML – Simple API for XML. Procesări...Web 2020 07/12: Procesarea datelor XML & HTML – Simple API for XML. Procesări...
Web 2020 07/12: Procesarea datelor XML & HTML – Simple API for XML. Procesări...Sabin Buraga
 
Web 2020 08/12: Servicii Web. De la arhitecturi orientate spre servicii la SO...
Web 2020 08/12: Servicii Web. De la arhitecturi orientate spre servicii la SO...Web 2020 08/12: Servicii Web. De la arhitecturi orientate spre servicii la SO...
Web 2020 08/12: Servicii Web. De la arhitecturi orientate spre servicii la SO...Sabin Buraga
 
Web 2020 09/12: Servicii Web. Paradigma REST
Web 2020 09/12: Servicii Web. Paradigma RESTWeb 2020 09/12: Servicii Web. Paradigma REST
Web 2020 09/12: Servicii Web. Paradigma RESTSabin Buraga
 
Web 2020 10/12: Servicii Web. Micro-servicii. Serverless. Specificarea API-ur...
Web 2020 10/12: Servicii Web. Micro-servicii. Serverless. Specificarea API-ur...Web 2020 10/12: Servicii Web. Micro-servicii. Serverless. Specificarea API-ur...
Web 2020 10/12: Servicii Web. Micro-servicii. Serverless. Specificarea API-ur...Sabin Buraga
 
Web 2020 11/12: Interacţiune Web asincronă. Aplicaţii Web de tip mash-up. JAM...
Web 2020 11/12: Interacţiune Web asincronă. Aplicaţii Web de tip mash-up. JAM...Web 2020 11/12: Interacţiune Web asincronă. Aplicaţii Web de tip mash-up. JAM...
Web 2020 11/12: Interacţiune Web asincronă. Aplicaţii Web de tip mash-up. JAM...Sabin Buraga
 
Web 2020 12/12: Securitatea aplicaţiilor Web. Aspecte esenţiale
Web 2020 12/12: Securitatea aplicaţiilor Web. Aspecte esenţialeWeb 2020 12/12: Securitatea aplicaţiilor Web. Aspecte esenţiale
Web 2020 12/12: Securitatea aplicaţiilor Web. Aspecte esenţialeSabin Buraga
 
STAW 01/12: Arhitectura aplicaţiilor Web
STAW 01/12: Arhitectura aplicaţiilor WebSTAW 01/12: Arhitectura aplicaţiilor Web
STAW 01/12: Arhitectura aplicaţiilor WebSabin Buraga
 
STAW 02/12: Programare Web: Limbajul JavaScript. Aspecte esenţiale
STAW 02/12: Programare Web: Limbajul JavaScript. Aspecte esenţialeSTAW 02/12: Programare Web: Limbajul JavaScript. Aspecte esenţiale
STAW 02/12: Programare Web: Limbajul JavaScript. Aspecte esenţialeSabin Buraga
 
STAW 03/12: Programare Web: Limbajul JavaScript. Aspecte moderne: ES6 et al.
STAW 03/12: Programare Web: Limbajul JavaScript. Aspecte moderne: ES6 et al.STAW 03/12: Programare Web: Limbajul JavaScript. Aspecte moderne: ES6 et al.
STAW 03/12: Programare Web: Limbajul JavaScript. Aspecte moderne: ES6 et al.Sabin Buraga
 
STAW 04/12: Programare Web: Node.js
STAW 04/12: Programare Web: Node.jsSTAW 04/12: Programare Web: Node.js
STAW 04/12: Programare Web: Node.jsSabin Buraga
 
STAW 05/12: Arhitectura navigatorului Web
STAW 05/12: Arhitectura navigatorului WebSTAW 05/12: Arhitectura navigatorului Web
STAW 05/12: Arhitectura navigatorului WebSabin Buraga
 
STAW 06/12: JavaScript în navigatorul Web. De la DOM la Ajax şi mash-up-uri
STAW 06/12: JavaScript în navigatorul Web. De la DOM la Ajax şi mash-up-uriSTAW 06/12: JavaScript în navigatorul Web. De la DOM la Ajax şi mash-up-uri
STAW 06/12: JavaScript în navigatorul Web. De la DOM la Ajax şi mash-up-uriSabin Buraga
 
STAW 07/12: Ingineria dezvoltării aplicaţiilor JavaScript
STAW 07/12: Ingineria dezvoltării aplicaţiilor JavaScriptSTAW 07/12: Ingineria dezvoltării aplicaţiilor JavaScript
STAW 07/12: Ingineria dezvoltării aplicaţiilor JavaScriptSabin Buraga
 
STAW 08/12: Programare Web. Suita de tehnologii HTML5
STAW 08/12: Programare Web. Suita de tehnologii HTML5STAW 08/12: Programare Web. Suita de tehnologii HTML5
STAW 08/12: Programare Web. Suita de tehnologii HTML5Sabin Buraga
 

Más de Sabin Buraga (20)

Web 2020 01/12: World Wide Web – aspecte arhitecturale
Web 2020 01/12: World Wide Web – aspecte arhitecturaleWeb 2020 01/12: World Wide Web – aspecte arhitecturale
Web 2020 01/12: World Wide Web – aspecte arhitecturale
 
Web 2020 02/12: Programare Web – HTTP. Cookie-uri. Sesiuni Web
Web 2020 02/12: Programare Web – HTTP. Cookie-uri. Sesiuni WebWeb 2020 02/12: Programare Web – HTTP. Cookie-uri. Sesiuni Web
Web 2020 02/12: Programare Web – HTTP. Cookie-uri. Sesiuni Web
 
Web 2020 03/12: Programare Web – Arhitectura aplicaţiilor Web. Inginerie Web
Web 2020 03/12: Programare Web – Arhitectura aplicaţiilor Web. Inginerie WebWeb 2020 03/12: Programare Web – Arhitectura aplicaţiilor Web. Inginerie Web
Web 2020 03/12: Programare Web – Arhitectura aplicaţiilor Web. Inginerie Web
 
Web 2020 04/12: Programare Web – Dezvoltarea aplicaţiilor Web în PHP
Web 2020 04/12: Programare Web – Dezvoltarea aplicaţiilor Web în PHP Web 2020 04/12: Programare Web – Dezvoltarea aplicaţiilor Web în PHP
Web 2020 04/12: Programare Web – Dezvoltarea aplicaţiilor Web în PHP
 
Web 2020 05/12: Modelarea datelor. Familia XML. Extragerea datelor cu XPath. ...
Web 2020 05/12: Modelarea datelor. Familia XML. Extragerea datelor cu XPath. ...Web 2020 05/12: Modelarea datelor. Familia XML. Extragerea datelor cu XPath. ...
Web 2020 05/12: Modelarea datelor. Familia XML. Extragerea datelor cu XPath. ...
 
Web 2020 06/12: Procesarea datelor XML & HTML. Document Object Model
Web 2020 06/12: Procesarea datelor XML & HTML. Document Object ModelWeb 2020 06/12: Procesarea datelor XML & HTML. Document Object Model
Web 2020 06/12: Procesarea datelor XML & HTML. Document Object Model
 
Web 2020 07/12: Procesarea datelor XML & HTML – Simple API for XML. Procesări...
Web 2020 07/12: Procesarea datelor XML & HTML – Simple API for XML. Procesări...Web 2020 07/12: Procesarea datelor XML & HTML – Simple API for XML. Procesări...
Web 2020 07/12: Procesarea datelor XML & HTML – Simple API for XML. Procesări...
 
Web 2020 08/12: Servicii Web. De la arhitecturi orientate spre servicii la SO...
Web 2020 08/12: Servicii Web. De la arhitecturi orientate spre servicii la SO...Web 2020 08/12: Servicii Web. De la arhitecturi orientate spre servicii la SO...
Web 2020 08/12: Servicii Web. De la arhitecturi orientate spre servicii la SO...
 
Web 2020 09/12: Servicii Web. Paradigma REST
Web 2020 09/12: Servicii Web. Paradigma RESTWeb 2020 09/12: Servicii Web. Paradigma REST
Web 2020 09/12: Servicii Web. Paradigma REST
 
Web 2020 10/12: Servicii Web. Micro-servicii. Serverless. Specificarea API-ur...
Web 2020 10/12: Servicii Web. Micro-servicii. Serverless. Specificarea API-ur...Web 2020 10/12: Servicii Web. Micro-servicii. Serverless. Specificarea API-ur...
Web 2020 10/12: Servicii Web. Micro-servicii. Serverless. Specificarea API-ur...
 
Web 2020 11/12: Interacţiune Web asincronă. Aplicaţii Web de tip mash-up. JAM...
Web 2020 11/12: Interacţiune Web asincronă. Aplicaţii Web de tip mash-up. JAM...Web 2020 11/12: Interacţiune Web asincronă. Aplicaţii Web de tip mash-up. JAM...
Web 2020 11/12: Interacţiune Web asincronă. Aplicaţii Web de tip mash-up. JAM...
 
Web 2020 12/12: Securitatea aplicaţiilor Web. Aspecte esenţiale
Web 2020 12/12: Securitatea aplicaţiilor Web. Aspecte esenţialeWeb 2020 12/12: Securitatea aplicaţiilor Web. Aspecte esenţiale
Web 2020 12/12: Securitatea aplicaţiilor Web. Aspecte esenţiale
 
STAW 01/12: Arhitectura aplicaţiilor Web
STAW 01/12: Arhitectura aplicaţiilor WebSTAW 01/12: Arhitectura aplicaţiilor Web
STAW 01/12: Arhitectura aplicaţiilor Web
 
STAW 02/12: Programare Web: Limbajul JavaScript. Aspecte esenţiale
STAW 02/12: Programare Web: Limbajul JavaScript. Aspecte esenţialeSTAW 02/12: Programare Web: Limbajul JavaScript. Aspecte esenţiale
STAW 02/12: Programare Web: Limbajul JavaScript. Aspecte esenţiale
 
STAW 03/12: Programare Web: Limbajul JavaScript. Aspecte moderne: ES6 et al.
STAW 03/12: Programare Web: Limbajul JavaScript. Aspecte moderne: ES6 et al.STAW 03/12: Programare Web: Limbajul JavaScript. Aspecte moderne: ES6 et al.
STAW 03/12: Programare Web: Limbajul JavaScript. Aspecte moderne: ES6 et al.
 
STAW 04/12: Programare Web: Node.js
STAW 04/12: Programare Web: Node.jsSTAW 04/12: Programare Web: Node.js
STAW 04/12: Programare Web: Node.js
 
STAW 05/12: Arhitectura navigatorului Web
STAW 05/12: Arhitectura navigatorului WebSTAW 05/12: Arhitectura navigatorului Web
STAW 05/12: Arhitectura navigatorului Web
 
STAW 06/12: JavaScript în navigatorul Web. De la DOM la Ajax şi mash-up-uri
STAW 06/12: JavaScript în navigatorul Web. De la DOM la Ajax şi mash-up-uriSTAW 06/12: JavaScript în navigatorul Web. De la DOM la Ajax şi mash-up-uri
STAW 06/12: JavaScript în navigatorul Web. De la DOM la Ajax şi mash-up-uri
 
STAW 07/12: Ingineria dezvoltării aplicaţiilor JavaScript
STAW 07/12: Ingineria dezvoltării aplicaţiilor JavaScriptSTAW 07/12: Ingineria dezvoltării aplicaţiilor JavaScript
STAW 07/12: Ingineria dezvoltării aplicaţiilor JavaScript
 
STAW 08/12: Programare Web. Suita de tehnologii HTML5
STAW 08/12: Programare Web. Suita de tehnologii HTML5STAW 08/12: Programare Web. Suita de tehnologii HTML5
STAW 08/12: Programare Web. Suita de tehnologii HTML5
 

Último

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

REST and some Python (or 'Python "sinners" must REST')

  • 1. Dr. Sabin Buraga – www.purl.org/net/busaco Python “sinners” must R⚗ST
  • 2. warning: some sensitive people might consider this presentation somewhat offensive in this situation, these persons are advised to immediately abandon all humour and better visit gore Websites for the real-life “fun” Thank you for understanding! 100% pure sarcasm & irony included
  • 3. So, our Web application must provide certain functionalities* to be consumed by software (not only by humans)… * desired data requested via HTTP http://www.boredpanda.com/funny-chinese-translation-fails/
  • 4. …Oh, by the way, what the Web is? 
  • 5. …Oh, by the way, what the Web is? content ≅ sexy <mark-ups/> + stylish CSS heartaches http://www.funnypicss.com/humor/i-know-html/
  • 6. …Oh, by the way, what the Web is? interaction ≅ URI + hypermedia (HTTP delights?) http://httpstatusdogs.com/
  • 7. …Oh, by the way, what the Web is? development ≅ client and/or server-side programming %#^&! paradigms/languages/frameworks/magic/… http://stressandanger.wordpress.com/funny-pictures/
  • 8. In order to satisfy some 〠 needs, the software must offer certain ☠ services* http://brog.engrish.com/ * the action of helping or doing work for someone
  • 9. Web service a piece of s…oftware providing a s…pecific functionality http://wallpaperstop.co/wallpapers/2013/07/Cats-Funny-Meme-272x480.jpg
  • 10. Web service a piece of s…oftware providing a s…pecific functionality access to resources of (dis)interest – Instagram, Pinterest, Tumblr boring news aggregators – Digg, Reddit (“surreal”) maps – Bing Maps, Google Maps, Nokia HERE instant mess(ages) – Jabber, Twitter, Twilio world-wide stupidity – see Facebook (Open Graph Protocol) (unsecure) data storage – Amazon S3, Dropbox, OneDrive …and many, many, many others
  • 11. Web service developed & deployed by using W3C standards URI (Unicorn Ridiculous Identifier) – aka Web address access via HTTP (Hyper Trickiest Triviality Provider) data formats: JSON (JavaScript Orgiastic Needs) XML (Exquisite Manual Labor) …
  • 12. Web service a classical implementation: using certain Web application servers/frameworks for Python, some popular choices are Django, Grok, TurboGears, web2py, Zope https://wiki.python.org/moin/WebFrameworks
  • 13. generic architecture of a traditional Web application (N-tier application) Client Web application Storage (user interface) server/framework (data persistence) Internet (Web)
  • 14. Web service goal: processing the answer (data) provided by a given Web site/application in order to (re)use it in our (client) programs http://nedhardy.com/2013/04/22/17-hilarious-ad-placement-fails/
  • 15. Web service a naïve solution: Web scraping extracting data of interest by parsing (incorrect) HTML constructs www.winhdwallpapers.com/funny/funny-html-code-hd-wallpaper-1080p
  • 16. Web service Web scraping several Python libraries: Beautiful Soup – www.crummy.com/software/BeautifulSoup/ html5lib-python – https://github.com/html5lib/html5lib-python lxml – http://lxml.de/ Scrappy – http://scrapy.org/
  • 17. How about an interesting* paradigm of Web service development? * aka pragmatic http://commons.wikimedia.org/wiki/File:France_Paris_Notre-Dame-Adam_and_Eve.jpg
  • 18. REST (REpresentational State Transfer) Web development focused on the representation(s) of a resource Roy Fielding – PhD Thesis (2000)
  • 19. REST (REpresentational State Transfer) Web development focused on the representation(s) of a resource e.g., user, blog, article, photo, source-code,…
  • 20. REST (REpresentational State Transfer) Web development focused on the representation(s) of a resource HTML, PNG, SVG, JSON,…
  • 21. REST (REpresentational State Transfer) Web development focused on the representation(s) of a resource denoted by MIME types: text/html, application/json,…
  • 22. each resource can have multiple representations accessed via HTTP requests
  • 23. clients (browsers, robots, players,…) interact with the resource representations via HTTP verbs: create: POST, retrieve: GET, update: PUT, delete: DELETE representation2 (Atom) resource URI URLURL GET POST GET DELETE representation1 (HTML)
  • 26. So, some practical advises about building RESTful Web services? http://www.funpedia.net/imgs/may11/very-funny-signs-06.jpg
  • 27. Use nouns for each class of resources to be managed by your service User Document – alternatives: Photo, Product, Software Metadata – e.g., Comment, Format, Platform, Tag,…
  • 28. Use nouns for each class of resources to be managed by your service collections of “things” (typically, plural) /snakes unique identifiers for every member of a collection /snakes/python versus /snakes/69
  • 29. SoundCloud API types of resources: tracks, users, current user (me), playlists, groups, comments http://developers.soundcloud.com/
  • 30. Name each resource by using URLs http://www.slideshare.net/busaco/presentations http://www.imdb.com/title/tt0401383/ http://www.last.fm/music/Moby http://vimeo.com/channels/731014
  • 31. Design accepted representations to be sent by potential clients + optional parameters (useful for pagination, partial responses, filtering,…) /snakes?limit=3&offset=14 /snakes?fields=name,age,description
  • 32. Choose the representation(s) of the response to be sent to client consider existing standardized data formats e.g., HTML, Atom, JSON,… Accept: application/json (Digg) /venue.json (Foursquare) http://api.sciencemuseum.org.uk/exhibitions/?output=json
  • 33. interactive access to the data provided by a public Web service http://developer.nytimes.com/ JSON response
  • 34. Integrate resources via URLs + Web forms
  • 35. Create use cases specify exception/error conditions via HTTP status codes + additional information 200 OK, 303 See Other, 400 Bad Request, 404 Not Found,… http://httpstatus.es/
  • 36. “Never release an API without a version and make the version mandatory.”—Brian Mulloy (2012) http://feeds.delicious.com/v2/{format}/{username} ?v=1.0 (Facebook)
  • 37. Some (programming) tools for developers? http://www.weirdasianews.com/category/engrish/
  • 38. Python HTTP clients classical built-in modules: httplib (Python 2) http.client (Python 3)
  • 39. Python HTTP clients a specific library: Unirest for Python – http://unirest.io/python.html
  • 40. Developing RESTful Web services in Python one of our favorite frameworks: Bottle, CheeryPy, Django REST, Flask, web.py
  • 41. using a Python wrapper for a specific Web service/API: www.pythonapi.com
  • 42. Useful Web resources for learning & making experiments?
  • 43. building a REST service: Learn REST: A RESTful Tutorial www.restapitutorial.com Thoughts on RESTful API Design https://restful-api-design.readthedocs.org Implementing REST https://code.google.com/p/implementing-rest/
  • 44. testing our/others APIs: Make HTTP Requests http://www.hurl.it/ HTTP Request & Response http://httpbin.org/ Apigee Console https://apigee.com/console/
  • 45. don’t forget to consult: ProgrammableWeb http://www.programmableweb.com/ The Web engineer’s online toolbox ivanzuzak.info/2012/11/18/the-web-engineers-online-toolbox.html