Communicating
on the
web


by

Adrian Cardenas (@aramonc)
https://joind.in/10020

hypertext 

transfer protocol



can't communicate 

without some 

common ground

Client

Server

http is stateless


The request

GET https://www.google.com/ HTTP/1.1
:version: HTTP/1.1
:method: GET
:scheme: https
:host: www.google.comuser-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36accept-encoding: gzip,deflate,sdchaccept-language: en-US,en;q=0.8,es-419;q=0.6,es;q=0.4accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8cookie: OGP=-3904011:; HSID=A0hmwhHriSEJzPSI; SSID=AKHSzv76RXaggJwJ; APISID=PXmCmOabqgrdcm_z/A7eIE7i4enNC0Hn0;

The Basics


 GET https://www.google.com/ HTTP/1.1

The Basics


 GET https://www.google.com/ HTTP/1.1

Methods / verbs

  • GET
  • POST
  • PUT
  • DELETE
  • HEAD
  • OPTIONS

The Basics


 GET https://www.google.com/ HTTP/1.1

The Basics


 GET https://www.google.com/ HTTP/1.1

COMMON HEADERS

 user-agent: Mozilla/5.0 (Macintosh; Intel 
 Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, 
 like Gecko) Chrome/31.0.1650.57 
 Safari/537.36

COMMON HEADERS

 accept-encoding: gzip,deflate,sdch
accept-language: en-US,en;q=0.8,es- 419;q=0.6,es;q=0.4
accept-charset: utf-8
accept: text/html,application/xhtml+xml, application/xml;q=0.9,image/webp,*/*;q=0.8

common headers

 cookie: OGP=-3904011:; 
 HSID=A0hmwhHriSEJzPSI; 
 SSID=AKHSzv76RXaggJwJ; 
 APISID=PXmCmOabqgrdcm_z/A7eIE7i4enNC0Hn0;

Not so common

 authorization: Basic 
 QWxhZGRpbjpvcGVuIHNlc2FtZQ==

NOT SO COMMON

 x-hello: world
 hello: world

request body

 
    Content-Type: multipart/form-data; boundary=AaB03x

   --AaB03x
   Content-Disposition: form-data; name="submit-name"

   Larry
   --AaB03x
   Content-Disposition: form-data; name="files"; 
   filename="file1.txt"
   Content-Type: text/plain

   ... contents of file1.txt ...
   --AaB03x--
   

Title

Made with Slides.com