On Github alexm / rest-in-theory
by Alex Muntada / @alexmuntada
Roy Fielding (2000)
W3C recommendation (2003)
Leonard Richardson, Sam Ruby (2007)
Leonard Richardson, Mike Amundsen, Sam Ruby (2013)
Bad, old, wrong or lack thereof.
POST /1.1/statuses/update.json HTTP/1.1 User-Agent: curl/7.35.0 Host: api.twitter.com Accept: */* Content-Length: 68 Content-Type: application/x-www-form-urlencoded status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk
HTTP/1.1 400 Bad Request
content-length: 61
content-type: application/json; charset=utf-8
date: Sun, 18 May 2014 19:30:43 UTC
server: tfe
set-cookie: guest_id=v1%3A140044144371735781; Domain=.twitter.com; Path=/; Expires=Tue, 17-May-2016 19:30:43 UTC
strict-transport-security: max-age=631138519
x-tfe-logging-request-category: API
{"errors":[{"message":"Bad Authentication data","code":215}]}
POST /1.1/statuses/update.json HTTP/1.1
User-Agent: curl/7.35.0
Host: api.twitter.com
Accept: */*
Content-Length: 68
Content-Type: application/x-www-form-urlencoded
Authorization:
OAuth oauth_consumer_key="xvz1evFS4wEEPTGEFPHBog",
oauth_nonce="kYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg",
oauth_signature="tnnArxj06cWHq44gCs1OSKk%2FjLY%3D",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1318622958",
oauth_token="370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb",
oauth_version="1.0"
status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk
Read several pages of documentation:
POST statuses/update Application-user authentication Using OAuth Authorizing a requestRESTful Web APIs, p. 360
by Alex Muntada / @alexmuntada