The last REST client you will ever need

It's better to REST in BED.

Loïc Hoguin - @lhoguin

Erlang Cowboy and Nine Nines founder

Why this talk?

REST is great

The family business

Open your mind

REST constraints

Client-server architecture

Stateless

Cacheable

Uniform interface

Layered system

Code on demand (optional)

Uniform interface in details

Resources and resource identifiers

Resource representations

Self-descriptive messages

Hypermedia as the engine of the application state

What media type should we use?

Not just one media type

Why not JSON?

Why not msgpack?

Why not HTML?

Why not XML?

What then?

BED

Goals

Media types 1/2

Media types 2/2

Hyperlink 1/2

Hyperlink 2/2

Symbol 1/9

Symbol 2/9

Symbol 3/9

Symbol 4/9

Symbol 5/9

Symbol 6/9

Symbol 7/9

Symbol 8/9

Symbol 9/9

Binary

String

RFC 3339 date

Integer

Floating-point

Map

Array

List

Extensions

Wrap-up

But wait...

Writing a REST client

Warning

Goals

HTTP client

HTTP client

Service map 1/2

Service map 2/2

Interface

Cache

Going further

Putting it to rest

Let's be lazy now!