SlideShare a Scribd company logo
How does the web work?
      aka HTTP 101




        by Guilherme Cavalcanti
                @guiocavalcanti
Schedule

1. Some Web Principles
2. REST
3. HTTP
      Verbs
      Idempotency
      Side effects
      GET and POST Vs. PUT and DELETE
4. Rails
5. AJAX vs. Accessibility
Some Web Principles

  Universality
  Any resource anywhere can be given a URI
  Any resource of significance should be given a URI.
      Resources are documents
      As well as concepts and abstract ideias (Semantic Web)
  Global Scope
  It doesn't matter to whom or where you specify that URI, it will
  have the same meaning.
REST

 Architectural style coined by Roy Fielding (phd dissertation)5
    State transference
    At any particular time, a client can either be in transition
    between application states or "at rest". A client in a rest state
    is able to interact with its user, but creates no load and
    consumes no per-client storage on the servers or on the
    network4
    The HTTP portocols uses the rest style
HTTP Verbs

 Side effect
    change or not the state of the world
 Idempotency
    the side-effects of N > 0 identical requests is the same as for a
    single request
HTTP Verbs



             Idempotent   Cacheable   Side effects

 GET
                 x            x

 POST
                                           x

 PUT
                 x                         x

 DELETE
                                           x
HTTP: RESTful services vs lack of verbs

  PUT
    Put ssomething at some place
    Updates something
     PUT http://redu.com.br/spaces/my-space
     Content: My new Space
  POST
     The server decides which action gonna be taken
     POST http://redu.com.br/spaces/filter
     Content: name=my;audience=[higher-edu,sat]
  DELETE
    Deletes some resource
     DELETE http://redu.com.br/spaces/my-space
HTTP: RESTful services vs lack of verbs

  Doesn't work on6
      < HTML 4
      < XHTML 1.0
  It works on
      XMLHttpRequests (aka AJAX)3
HTTP: RESTful services vs lack of verbs

  POST acting as PUT
    POST http://redu.com.br/spaces
    Content: name=My Space;path=my-space
  POST acting as PUT when updating
    POST http://redu.com.br/spaces/my-space
    Content: _method=PUT
  POST acting as DELETE
     POST http://redu.com.br/spaces/my-space
     Content: _method=DELETE
How Rails deals with it?

Edit:
References

1.   Why put and delete?
2.   HTTP RFC
3.   Verbs support
4.   REST
5.   Roy's dissertation
6.   Useful question at Stackoverflow

More Related Content

Similar to How does the Web work?

REST API Laravel
REST API LaravelREST API Laravel
REST API Laravel
John Dave Decano
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restish
Grig Gheorghiu
 
Designing RESTful APIs
Designing RESTful APIsDesigning RESTful APIs
Designing RESTful APIs
anandology
 
Rest
RestRest
REST library.pptx
REST library.pptxREST library.pptx
REST library.pptx
MSivani
 
REST and Web API
REST and Web APIREST and Web API
REST and Web API
IT Weekend
 
REST and Web API
REST and Web APIREST and Web API
REST and Web API
Roman Kalita
 
HTTPs Strict Transport Security
HTTPs    Strict Transport Security HTTPs    Strict Transport Security
HTTPs Strict Transport Security
Gol D Roger
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
Jean Michel
 
Why do you need REST
Why do you need RESTWhy do you need REST
Why do you need REST
Mayank Srivastava
 
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIsHTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
Roan Brasil Monteiro
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
Sudheer Satyanarayana
 
REST in ( a mobile ) peace @ WHYMCA 05-21-2011
REST in ( a mobile ) peace @ WHYMCA 05-21-2011REST in ( a mobile ) peace @ WHYMCA 05-21-2011
REST in ( a mobile ) peace @ WHYMCA 05-21-2011
Alessandro Nadalin
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
Aniruddh Bhilvare
 
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
ruyalarcon
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01
raviIITRoorkee
 
Restful web services
Restful web servicesRestful web services
Restful web services
Surinder Mehra
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
vikram singh
 
HTTP: the Other ESB
HTTP: the Other ESBHTTP: the Other ESB
HTTP: the Other ESB
Ryan Riley
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technology
vikram singh
 

Similar to How does the Web work? (20)

REST API Laravel
REST API LaravelREST API Laravel
REST API Laravel
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restish
 
Designing RESTful APIs
Designing RESTful APIsDesigning RESTful APIs
Designing RESTful APIs
 
Rest
RestRest
Rest
 
REST library.pptx
REST library.pptxREST library.pptx
REST library.pptx
 
REST and Web API
REST and Web APIREST and Web API
REST and Web API
 
REST and Web API
REST and Web APIREST and Web API
REST and Web API
 
HTTPs Strict Transport Security
HTTPs    Strict Transport Security HTTPs    Strict Transport Security
HTTPs Strict Transport Security
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
 
Why do you need REST
Why do you need RESTWhy do you need REST
Why do you need REST
 
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIsHTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
 
REST in ( a mobile ) peace @ WHYMCA 05-21-2011
REST in ( a mobile ) peace @ WHYMCA 05-21-2011REST in ( a mobile ) peace @ WHYMCA 05-21-2011
REST in ( a mobile ) peace @ WHYMCA 05-21-2011
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01
 
Restful web services
Restful web servicesRestful web services
Restful web services
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
 
HTTP: the Other ESB
HTTP: the Other ESBHTTP: the Other ESB
HTTP: the Other ESB
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technology
 

More from Guilherme

Where Does the Fat Goes? Utilizando Form Objects Para Simplificar seu Código
Where Does the Fat Goes? Utilizando Form Objects Para Simplificar seu CódigoWhere Does the Fat Goes? Utilizando Form Objects Para Simplificar seu Código
Where Does the Fat Goes? Utilizando Form Objects Para Simplificar seu Código
Guilherme
 
Descobrindo APIs REST
Descobrindo APIs RESTDescobrindo APIs REST
Descobrindo APIs REST
Guilherme
 
Redu walled garden
Redu walled gardenRedu walled garden
Redu walled garden
Guilherme
 
Desafio de crescer
Desafio de crescerDesafio de crescer
Desafio de crescer
Guilherme
 
Consumindo APIs REST com Ruby
Consumindo APIs REST com RubyConsumindo APIs REST com Ruby
Consumindo APIs REST com Ruby
Guilherme
 
Aplicações tipo Canvas no Redu com Rails
Aplicações tipo Canvas no Redu com RailsAplicações tipo Canvas no Redu com Rails
Aplicações tipo Canvas no Redu com Rails
Guilherme
 
Aplicações sociais usando a plataforma Redu
Aplicações sociais usando a plataforma ReduAplicações sociais usando a plataforma Redu
Aplicações sociais usando a plataforma Redu
Guilherme
 
Introdução aos aplicativos tipo canvas
Introdução aos aplicativos tipo canvasIntrodução aos aplicativos tipo canvas
Introdução aos aplicativos tipo canvas
Guilherme
 
Introdução a plataforma de aplicativos Redu
Introdução a plataforma de aplicativos ReduIntrodução a plataforma de aplicativos Redu
Introdução a plataforma de aplicativos Redu
Guilherme
 
FLOSS and Startups
FLOSS and StartupsFLOSS and Startups
FLOSS and Startups
Guilherme
 
Ruby 101 && Coding Dojo
Ruby 101 && Coding DojoRuby 101 && Coding Dojo
Ruby 101 && Coding Dojo
Guilherme
 
Dojo: Sass - Syntactically Awesome Stylesheets
Dojo: Sass - Syntactically Awesome StylesheetsDojo: Sass - Syntactically Awesome Stylesheets
Dojo: Sass - Syntactically Awesome Stylesheets
Guilherme
 
Sass
SassSass
Sass
Guilherme
 
CSS first steps
CSS first stepsCSS first steps
CSS first steps
Guilherme
 
0 introducao padroes_web
0 introducao padroes_web0 introducao padroes_web
0 introducao padroes_web
Guilherme
 
Plano de Pesquisa - Redu Respostas
Plano de Pesquisa - Redu RespostasPlano de Pesquisa - Redu Respostas
Plano de Pesquisa - Redu Respostas
Guilherme
 
Desevolvimento Web Client-side - AJAX
Desevolvimento Web Client-side - AJAX Desevolvimento Web Client-side - AJAX
Desevolvimento Web Client-side - AJAX
Guilherme
 
Desevolvimento Web Client-side - jQuery
Desevolvimento Web Client-side - jQueryDesevolvimento Web Client-side - jQuery
Desevolvimento Web Client-side - jQuery
Guilherme
 
3 padroes-web-intro-javascript
3 padroes-web-intro-javascript3 padroes-web-intro-javascript
3 padroes-web-intro-javascript
Guilherme
 
Desevolvimento Web Client-side - CSS
Desevolvimento Web Client-side - CSSDesevolvimento Web Client-side - CSS
Desevolvimento Web Client-side - CSSGuilherme
 

More from Guilherme (20)

Where Does the Fat Goes? Utilizando Form Objects Para Simplificar seu Código
Where Does the Fat Goes? Utilizando Form Objects Para Simplificar seu CódigoWhere Does the Fat Goes? Utilizando Form Objects Para Simplificar seu Código
Where Does the Fat Goes? Utilizando Form Objects Para Simplificar seu Código
 
Descobrindo APIs REST
Descobrindo APIs RESTDescobrindo APIs REST
Descobrindo APIs REST
 
Redu walled garden
Redu walled gardenRedu walled garden
Redu walled garden
 
Desafio de crescer
Desafio de crescerDesafio de crescer
Desafio de crescer
 
Consumindo APIs REST com Ruby
Consumindo APIs REST com RubyConsumindo APIs REST com Ruby
Consumindo APIs REST com Ruby
 
Aplicações tipo Canvas no Redu com Rails
Aplicações tipo Canvas no Redu com RailsAplicações tipo Canvas no Redu com Rails
Aplicações tipo Canvas no Redu com Rails
 
Aplicações sociais usando a plataforma Redu
Aplicações sociais usando a plataforma ReduAplicações sociais usando a plataforma Redu
Aplicações sociais usando a plataforma Redu
 
Introdução aos aplicativos tipo canvas
Introdução aos aplicativos tipo canvasIntrodução aos aplicativos tipo canvas
Introdução aos aplicativos tipo canvas
 
Introdução a plataforma de aplicativos Redu
Introdução a plataforma de aplicativos ReduIntrodução a plataforma de aplicativos Redu
Introdução a plataforma de aplicativos Redu
 
FLOSS and Startups
FLOSS and StartupsFLOSS and Startups
FLOSS and Startups
 
Ruby 101 && Coding Dojo
Ruby 101 && Coding DojoRuby 101 && Coding Dojo
Ruby 101 && Coding Dojo
 
Dojo: Sass - Syntactically Awesome Stylesheets
Dojo: Sass - Syntactically Awesome StylesheetsDojo: Sass - Syntactically Awesome Stylesheets
Dojo: Sass - Syntactically Awesome Stylesheets
 
Sass
SassSass
Sass
 
CSS first steps
CSS first stepsCSS first steps
CSS first steps
 
0 introducao padroes_web
0 introducao padroes_web0 introducao padroes_web
0 introducao padroes_web
 
Plano de Pesquisa - Redu Respostas
Plano de Pesquisa - Redu RespostasPlano de Pesquisa - Redu Respostas
Plano de Pesquisa - Redu Respostas
 
Desevolvimento Web Client-side - AJAX
Desevolvimento Web Client-side - AJAX Desevolvimento Web Client-side - AJAX
Desevolvimento Web Client-side - AJAX
 
Desevolvimento Web Client-side - jQuery
Desevolvimento Web Client-side - jQueryDesevolvimento Web Client-side - jQuery
Desevolvimento Web Client-side - jQuery
 
3 padroes-web-intro-javascript
3 padroes-web-intro-javascript3 padroes-web-intro-javascript
3 padroes-web-intro-javascript
 
Desevolvimento Web Client-side - CSS
Desevolvimento Web Client-side - CSSDesevolvimento Web Client-side - CSS
Desevolvimento Web Client-side - CSS
 

Recently uploaded

UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 

Recently uploaded (20)

UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 

How does the Web work?

  • 1. How does the web work? aka HTTP 101 by Guilherme Cavalcanti @guiocavalcanti
  • 2. Schedule 1. Some Web Principles 2. REST 3. HTTP Verbs Idempotency Side effects GET and POST Vs. PUT and DELETE 4. Rails 5. AJAX vs. Accessibility
  • 3. Some Web Principles Universality Any resource anywhere can be given a URI Any resource of significance should be given a URI. Resources are documents As well as concepts and abstract ideias (Semantic Web) Global Scope It doesn't matter to whom or where you specify that URI, it will have the same meaning.
  • 4. REST Architectural style coined by Roy Fielding (phd dissertation)5 State transference At any particular time, a client can either be in transition between application states or "at rest". A client in a rest state is able to interact with its user, but creates no load and consumes no per-client storage on the servers or on the network4 The HTTP portocols uses the rest style
  • 5. HTTP Verbs Side effect change or not the state of the world Idempotency the side-effects of N > 0 identical requests is the same as for a single request
  • 6. HTTP Verbs Idempotent Cacheable Side effects GET x x POST x PUT x x DELETE x
  • 7. HTTP: RESTful services vs lack of verbs PUT Put ssomething at some place Updates something PUT http://redu.com.br/spaces/my-space Content: My new Space POST The server decides which action gonna be taken POST http://redu.com.br/spaces/filter Content: name=my;audience=[higher-edu,sat] DELETE Deletes some resource DELETE http://redu.com.br/spaces/my-space
  • 8. HTTP: RESTful services vs lack of verbs Doesn't work on6 < HTML 4 < XHTML 1.0 It works on XMLHttpRequests (aka AJAX)3
  • 9. HTTP: RESTful services vs lack of verbs POST acting as PUT POST http://redu.com.br/spaces Content: name=My Space;path=my-space POST acting as PUT when updating POST http://redu.com.br/spaces/my-space Content: _method=PUT POST acting as DELETE POST http://redu.com.br/spaces/my-space Content: _method=DELETE
  • 10. How Rails deals with it? Edit:
  • 11. References 1. Why put and delete? 2. HTTP RFC 3. Verbs support 4. REST 5. Roy's dissertation 6. Useful question at Stackoverflow