{"id":301,"date":"2006-08-03T22:04:00","date_gmt":"2006-08-03T22:04:00","guid":{"rendered":"http:\/\/new.tola.me.uk\/blog\/2006\/08\/03\/restful-url-design-and-stuff\/"},"modified":"2006-08-03T22:04:00","modified_gmt":"2006-08-03T22:04:00","slug":"restful-url-design-and-stuff","status":"publish","type":"post","link":"https:\/\/tola.me.uk\/blog\/2006\/08\/03\/restful-url-design-and-stuff\/","title":{"rendered":"RESTful URL design&#8230; and stuff"},"content":{"rendered":"<p>I have a question about <a href=\"http:\/\/en.wikipedia.org\/wiki\/Representational_State_Transfer\">REST<\/a>ful URLs which is going to sound pretty trivial and boring unless you&#8217;re a RESTafarian&#8230; apparently they exist.<\/p>\n<p>Say I have a resource with the URL <a class=\"moz-txt-link-freetext\" href=\"http:\/\/widgets.com\/widget\/1\">http:\/\/widgets.com\/widget\/1<\/a> to which I can GET, POST, PUT  and DELETE. If I want the user to have an overview of widget 1 they  can GET this URL, similarly for DELETE. But if I want to point them to a form where they can  edit the widget (which I don&#8217;t necessarily want to display by default),  what would a RESTful URL be?<\/p>\n<p>http:\/\/widget.com\/widget\/1\/edit ?<br \/>http:\/\/widget.com\/widget\/1?action=edit ?<br \/>http:\/\/widget.com\/widget\/edit\/1 ?<\/p>\n<p>What if I have a page which lists all my widgets, should that be<br \/>http:\/\/widget.com\/widgets<br \/>or<br \/>http:\/\/widget.com\/widget ?<\/p>\n<p>There&#8217;s an article on <a href=\"http:\/\/www.w3.org\/Provider\/Style\/URI\">URI design<\/a> by <a href=\"http:\/\/www.w3.org\/People\/Berners-Lee\/\">Timbl<\/a> which contains lots of &#8220;don&#8217;t&#8221;s but not many &#8220;do&#8221;s.<\/p>\n<h3>In other news&#8230;<\/h3>\n<p>I am furious with PlusNet for <a href=\"http:\/\/portal.plus.net\/supportpages.html?a=2&amp;support_action=messages&amp;ispservice_id=email\">losing<\/a> two years worth of emails I had stored on their IMAP server (along with everyone else&#8217;s). I had &#8220;backup email&#8221; on my to do list for about a year, shame I relied on an ISP to back up my data. There were a lot of important emails in that inbox. I&#8217;m going to start looking into running my own mail server so at least if I lose data I know it&#8217;s only my own fault. I&#8217;ve been meaning to play with <a href=\"http:\/\/www.hula-project.org\/Hula_Project\">Hula<\/a> for ages but I&#8217;ve been waiting for their first stable release for over a year! They gave a talk at LugRadio Live and it sounds like the stable release is coming, but it&#8217;s still going to be a while (I can&#8217;t help but feel they&#8217;ve <a href=\"http:\/\/zimbra.com\/\">missed the boat<\/a> a bit). I also have a book on Postfix which I might dig out.<\/p>\n<p>Continuing in the theme of storing my own data, I&#8217;ve started on a new Drupal version of my now 5 year old homepage, which I plan to migrate my LiveJournal blog to if and when I figure out how to do it.<\/p>\n<p>I found out that I didn&#8217;t win the IET Write Around the World Competition again this year, no suprises there really. The judges&#8217; feedback boiled down to: well written, technically sound but boring as hell! I admit they have a point, I didn&#8217;t like it myself once it was finished.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a question about RESTful URLs which is going to sound pretty trivial and boring unless you&#8217;re a RESTafarian&#8230; apparently they exist. Say I have a resource with the URL http:\/\/widgets.com\/widget\/1 to which I can GET, POST, PUT and DELETE. If I want the user to have an overview of widget 1 they can &hellip; <a href=\"https:\/\/tola.me.uk\/blog\/2006\/08\/03\/restful-url-design-and-stuff\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">RESTful URL design&#8230; and stuff<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4,2],"class_list":["post-301","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-personal","tag-technology"],"_links":{"self":[{"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/posts\/301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":0,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"wp:attachment":[{"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}