{"id":123,"date":"2003-05-13T12:30:00","date_gmt":"2003-05-13T16:30:00","guid":{"rendered":"http:\/\/www.markbaker.ca\/wp\/?p=190"},"modified":"2003-05-13T12:30:00","modified_gmt":"2003-05-13T16:30:00","slug":"tim-bray-on-rest-and-web-services","status":"publish","type":"post","link":"http:\/\/www.markbaker.ca\/blog\/2003\/05\/tim-bray-on-rest-and-web-services\/","title":{"rendered":"Tim Bray on REST and Web services"},"content":{"rendered":"<p>A very nice piece from Tim on\n<a href=\"http:\/\/tbray.org\/ongoing\/When\/200x\/2003\/05\/12\/SoapAgain\">how Web services should look<\/a>; RESTful.<\/p>\n\n<p><a href=\"http:\/\/scriptingnews.userland.com\/2003\/05\/13#aSimpleAdmonition\">Dave<\/a>,\n<a href=\"http:\/\/www.intertwingly.net\/blog\/1402.html\">Sam<\/a>, and\n<a href=\"http:\/\/www.docuverse.com\/blog\/donpark\/2003\/05\/13.html#a485\">Don<\/a>\nhave all responded.<\/p>\n\n<p>First, to Tim, right on man.  It&#8217;s about time too.  For quite a while, he&#8217;s\nseemed to be on the fence, but this seems to make it quite clear\nwhere he stands, and hopefully where he&#8217;ll be voting on\n<a href=\"http:\/\/www.markbaker.ca\/blog\/\/2003\/01\/04#2003-01-ws-predictions\">Decision Day<\/a>.\nPerhaps with a name as well respected as his firmly in the REST camp, more\npeople will take notice.<\/p>\n\n<p>To Sam, a couple of points.  First, safety != idempotency.  Safety means\nmessages don&#8217;t change state (roughly).  Idempotency means multiple messages\nhave the same effect as one.  All safe operations are idempotent, but not all\nidempotent operations are safe.  For example, PUT is idempotent but not safe.\nIn addition, having the response change for a GET, even in a very short\nperiod of time, is perfectly RESTful.  What isn&#8217;t RESTful is if the result\nchanges <em>because<\/em> GET was invoked (and the owner cares about the\nchange).<\/p>\n\n<p>Also, the &#8220;take three parameters&#8221; analogue misses a major point I believe.\nIn the POST\/SOAP\/XML-RPC case, sure you get the same info back, but you\nhave no way to refer to that info, or pass references around to other\nparties.  When you marshal data into a http URI, you are creating a token\nwhich has associated with it a <a href=\"http:\/\/www.ietf.org\/rfc\/rfc2616.txt\">publicly specified method<\/a>\nfor dereferencing.  That is a vast improvement over the one-time use-and-consume\napproach of POST for retrievals.<\/p>","protected":false},"excerpt":{"rendered":"A very nice piece from Tim on how Web services should look; RESTful. Dave, Sam, and Don have all responded. First, to Tim, right on man. It&#8217;s about time too. For quite a while, he&#8217;s seemed to be on the fence, but this seems to make it quite clear where he stands, and hopefully where [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,40],"class_list":["post-123","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-soap","tag-xml"],"_links":{"self":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/comments?post=123"}],"version-history":[{"count":0,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/123\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/tags?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}