$30 off During Our Annual Pro Sale. View Details »

Gotta Wear Shades: The Bright Future of HTTP (CoderFaire Nashville 2013)

Gotta Wear Shades: The Bright Future of HTTP (CoderFaire Nashville 2013)

Hypertext Transfer Protocol (HTTP) version 1.1 was published in June of 1999. Almost fifteen years have passed. In that time, the Web has seen many changes, but it would seem that, throughout this time, HTTP has remained fixed, stagnant. Yet, nothing could be further from the truth.

HTTP is evolving, like languages, through common usage and need. In this talk, Ben Ramsey discusses the past fifteen years of HTTP and how it has changed through the introduction of new methods and headers. He covers the current state of the protocol and the new HTTPbis Working Group that is drafting new RFCs to clarify HTTP. Finally, the talk will take a look at proposals for HTTP version 2 and what this means for web developers.

Ben Ramsey
PRO

August 17, 2013
Tweet

More Decks by Ben Ramsey

Other Decks in Programming

Transcript

  1. Ben Ramsey
    Gotta Wear Shades
    The Bright Future of HTTP

    View Slide

  2. Hypertext
    Transfer
    Protocol

    View Slide

  3. 1991: HTTP/0.9

    View Slide

  4. 1992-95: HTTP/1.0 draft

    View Slide

  5. 1996: HTTP/1.0
    RFC 1945

    View Slide

  6. 1997: HTTP/1.1
    RFC 2068

    View Slide

  7. 1999: HTTP/1.1
    RFC 2616

    View Slide

  8. 2005
    2000

    View Slide

  9. 2010

    View Slide

  10. 2013

    View Slide

  11. HTTP
    Refresher
    Course

    View Slide

  12. Methods
    GET
    HEAD
    POST
    PUT
    DELETE
    OPTIONS
    TRACE
    CONNECT

    View Slide

  13. Status Codes
    1xx: Informational
    2xx: Successful
    3xx: Redirection
    4xx: Client error
    5xx: Server error

    View Slide

  14. Selected Headers
    Accept
    Authorization
    Cache-Control
    Content-Type
    Date
    ETag
    If-Match
    If-Modified-Since
    Last-Modified
    Location
    Range
    Referer
    User-Agent
    WWW-Authenticate

    View Slide

  15. Extensions
    to HTTP/1.1

    View Slide

  16. WebDAV
    Web Distributed Authoring
    and Versioning
    RFC 4918

    View Slide

  17. WebDAV gives us the
    concept of collection
    resources.

    View Slide

  18. Collection:
    http://example.org/books/
    Item:
    http://example.org/books/1984

    View Slide

  19. PATCH
    Allows a set of changes to be
    described, rather than the full
    entity body.
    RFC 5789

    View Slide

  20. OPTIONS /books/1984 HTTP/1.1
    Host: example.org
    HTTP/1.1 200 OK
    Allow:
    GET, HEAD, PUT, PATCH, OPTIONS, DELETE
    Accept-Patch:
    application/json-patch+json, text/diff

    View Slide

  21. PATCH /books/1984 HTTP/1.1
    Host: example.org
    Content-Length: 188
    Content-Type: application/json-patch+json
    [
    {
    "op": "replace",
    "path": "/isbn",
    "value": "978-0452262935"
    },
    {
    "op": "add",
    "path": "/asin",
    "value": "0452262933"
    }
    ]

    View Slide

  22. More Status Codes
    Defines new codes for a
    variety of common uses, to
    improve interoperability, and
    to avoid confusion.
    RFC 6585

    View Slide

  23. 428 Precondition Required

    View Slide

  24. 429 Too Many Requests

    View Slide

  25. 431 Request Header Fields
    Too Large

    View Slide

  26. Web Linking
    Defines a framework for
    typed links not specific to an
    application, and introduced
    the Link header.
    RFC 5988

    View Slide

  27. GET /books/?page=2 HTTP/1.1
    Host: example.org
    HTTP/1.1 200 OK
    Content-Type: text/html
    Link: ;
    rel="previous"; title="Page 1",
    ;
    rel="next"; title="Page 3"

    View Slide

  28. Prefer Header
    Defines a header used by the
    client to request certain
    server behaviors when
    processing a request.
    draft-snell-http-prefer-18

    View Slide

  29. POST /collection HTTP/1.1
    Host: example.org
    Content-Type: text/plain
    Prefer: respond-async
    {Data}
    HTTP/1.1 202 Accepted
    Location: http://example.org/collection/
    123
    Preference-Applied: respond-async

    View Slide

  30. POST /collection HTTP/1.1
    Host: example.org
    Content-Type: text/plain
    Prefer: return=minimal
    {Data}
    HTTP/1.1 201 Created
    Location: http://example.org/collection/
    123
    Preference-Applied: return=minimal

    View Slide

  31. Other
    Cookie, RFC 6265
    Content-Disposition, RFC 6266
    Web Origin, RFC 6454
    Deprecating “X-”
    , RFC 6648

    View Slide

  32. HTTPbis
    Working
    Group

    View Slide

  33. bis
    bis is a Latin adverb meaning
    “twice”

    View Slide

  34. Charter
    Charged with maintaining and
    developing the "core"
    specifications for HTTP
    .
    They have three deliverables.

    View Slide

  35. A document (or set of documents)
    that is suitable to supersede RFC
    2616 as the definition of HTTP/1.1
    and move RFC 2817 to Historic
    status

    View Slide

  36. A document cataloguing the
    security properties of HTTP/1.1

    View Slide

  37. A document (or set of documents)
    that specifies HTTP/2.0, an
    improved binding of HTTP's
    semantics to an underlying
    transport.

    View Slide

  38. Superseding 1.1
    Message Syntax and Routing
    Semantics and Content
    Conditional Requests
    Range Requests
    Caching
    Authentication

    View Slide

  39. Additional
    Method Registrations
    Auth Scheme Registrations

    View Slide

  40. HTTP/2.0
    A new message encapsulation to
    enable efficient use of network
    resources and reduced latency
    through header field compression
    and multiple concurrent messages
    on the same connection.

    View Slide

  41. It also introduces unsolicited push
    of representations from servers to
    clients!

    View Slide

  42. It does not obsolete HTTP/1.1.

    View Slide

  43. It is based on the SPDY Protocol.

    View Slide

  44. Key Concepts
    Frames
    Streams
    Server Push

    View Slide

  45. Frames
    HTTP messages are encoded
    into frames. These frames are
    a more efficient serialization
    of the message.

    View Slide

  46. Streams
    A single connection may
    contain multiple concurrently
    active streams. They may be
    shared by the client or server.

    View Slide

  47. Server Push
    A server may send multiple
    resources to the client in
    response to a single request.

    View Slide

  48. So, where are we?

    View Slide

  49. What can I do now?

    View Slide

  50. HTTP/1.1

    View Slide

  51. SPDY

    View Slide

  52. HTTP/2.0

    View Slide

  53. Thank you
    Ben Ramsey
    benramsey.com
    @ramsey

    View Slide

  54. Resources
    HTTP/0.9 (1991):
    http://www.w3.org/Protocols/HTTP/AsImplemented.html
    HTTP/1.0 (draft 1992):
    http://www.w3.org/Protocols/HTTP/HTTP2.html
    HTTP/1.0 (draft 1994):
    http://tools.ietf.org/html/draft-fielding-http-spec-00
    HTTP 1.0 (May 1996):
    http://tools.ietf.org/html/rfc1945
    HTTP/1.1 (Jan 1997):
    http://tools.ietf.org/html/rfc2068 (obsoleted by RFC 2616)
    HTTP/1.1 (Jun 1999):
    http://tools.ietf.org/html/rfc2616

    View Slide

  55. Resources
    WebDAV:
    http://www.webdav.org/
    Well-known URIs:
    http://tools.ietf.org/html/rfc5785
    Additional HTTP Status Codes:
    http://tools.ietf.org/html/rfc6585
    Web Linking:
    http://tools.ietf.org/html/rfc5988
    Deprecating the "X-" Prefix header:
    http://tools.ietf.org/html/rfc6648
    Use of Content-Disposition:
    http://tools.ietf.org/html/rfc6266

    View Slide

  56. Resources
    HTTP Header Fields Registrations:
    http://tools.ietf.org/html/rfc4229
    Prefer Header:
    http://tools.ietf.org/html/draft-snell-http-prefer-18
    Well-known URI Registry:
    http://www.iana.org/assignments/well-known-uris/
    Method Header Fields Registry:
    http://www.iana.org/assignments/message-headers/
    HTTP Status Codes Registry:
    https://www.iana.org/assignments/http-status-codes/
    JSON Patch:
    http://tools.ietf.org/html/rfc6902

    View Slide

  57. Resources
    HTTPbis:
    http://datatracker.ietf.org/wg/httpbis/
    HTTP Method Registrations:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-method-registrations/
    HTTP Auth Scheme Registrations:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-authscheme-
    registrations/

    View Slide

  58. Resources
    HTTP/1.1 Message Syntax and Routing:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-p1-messaging/
    HTTP/1.1 Semantics and Content:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-p2-semantics/
    HTTP/1.1 Conditional Requests:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-p4-conditional/
    HTTP/1.1 Range Requests:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-p5-range/
    HTTP/1.1 Caching:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-p6-cache/
    HTTP/1.1 Authentication:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-p7-auth/

    View Slide

  59. Resources
    HTTP/2.0:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-http2/
    HTTP/2.0 Header Compression:
    http://datatracker.ietf.org/doc/draft-ietf-httpbis-header-compression/
    Web Socket Protocol:
    http://tools.ietf.org/html/rfc6455
    SPDY Protocol:
    http://tools.ietf.org/html/draft-mbelshe-httpbis-spdy-00
    Apache mod_spdy:
    https://code.google.com/p/mod-spdy/
    Nginx SPDY Module:
    http://nginx.org/en/docs/http/ngx_http_spdy_module.html

    View Slide

  60. Gotta Wear Shades: The Bright Future of HTTP
    Copyright © Ben Ramsey. Some rights reserved.
    This work is licensed under a Creative Commons
    Attribution-NonCommercial-NoDerivs 3.0 Unported.
    For uses not covered under this license, please contact the
    author.
    Ramsey, Ben. “Gotta Wear Shades: The Bright Future of
    HTTP.” CoderFaire. Nashville School of Law, Nashville, TN.
    17 August 2013. Conference Presentation.

    View Slide