HTTP,RESTand the PATCH verb(accompanied by kittens) Thomas Parslow @almostobsolete http://almostobsolete.net
Web servicesThe web is used by machines as well as humansWeb services are like web sites for machines Various ways to design web services RPC SOAP (please no)
HTTP is awesome!SimpleCommon set of operationsLibraries in every language Compression? Encryption? Cacheing? Http has got it covered...
RESTThink in nouns not verbs!Resources are nounsResources are addressable and linkedhttp://example.com/blogpost/1NOT: http://example.com/get_blogpost
Current main HTTP verbs Replace! Destroy! Do stuff!Show! GET DELETE POST PUT
Why REST?Trendy buzzwordDiscoverable, self describingAPIsLess special cases and one offsMore maintanableLess code!
Real world example: Telephone conference control Get conference details (GET) Lock/Unlock Record On/ Record Off End conference Conference Add caller (dialout) Get List Of CallersEvict callerMute Caller CallerUnmute caller
Real world example: Telephone conference control Get conference details (GET) Lock/Unlock (PUT) Conference Record On/ Record Off (PUT) End conference (DELETE) Get list of callers (GET) Caller List Add caller (dialout) (POST)Caller Get caller details (GET) Evict caller (DELETE) Mute Caller (PUT) Unmute caller (PUT)
Partial updates WHY?Efficiency: Large resourcesConcurrency: Multiple people changing at once Approaches used:Overloaded POST - One of operations are bad :(Split up resource - End up with unnatural resource divisions
The PATCH VerbNew HTTP verbPartially updates a documentNeither idempotent nor safePatch format unspecifiedhttp://tools.ietf.org/html/rfc5789
Thanks for listening!Questions? @almostobsolete