{"id":121,"date":"2005-06-18T21:38:02","date_gmt":"2005-06-18T20:38:02","guid":{"rendered":"http:\/\/www.nobugs.org\/blog\/?p=121"},"modified":"2005-06-18T21:39:02","modified_gmt":"2005-06-18T20:39:02","slug":"that-cant-be-happening","status":"publish","type":"post","link":"https:\/\/www.nobugs.org\/blog\/archives\/2005\/06\/18\/that-cant-be-happening\/","title":{"rendered":"That can&#8217;t be happening"},"content":{"rendered":"<p>I&#8217;m writing a neat program which uses the flickr.com <a href=\"http:\/\/www.flickr.com\/services\/api\/\">web services API<\/a>.  At first, I tried the python bindings but then I got frustrated with them.  Python, whilst a pretty decent dynamically-typed language, feels like smalltalk without any of the good tools.  So, since I&#8217;m writing this program for my own use, I ditched python and started using <a href=\"http:\/\/www.squeak.org\">Squeak<\/a> instead.  Woo, squeak is so much more fun!<\/p>\n<p>However, I got stuck the other day when I tried using some of the flickr methods, like setTags(), which require you to use HTTP POST and provide username\/password to prove that you are allowed to change tags.  I would send off the request, and flickr would send me back an XML response saying &#8220;user not logged in&#8221;.  I checked and double checked the request I was sending, but it still didn&#8217;t work.  I found <a href=\"https:\/\/tcpmon.dev.java.net\/\">tcpmon<\/a> which is a lightweight tool which makes it easy to trace the requests.  Everything looked okay, but I still got an error back.  In the end, I felt like I was banging my head against a brick wall.  I couldn&#8217;t debug beyond the API boundary to find out what flickr.com thought was happening.  I decided to give up for the day, and saved the squeak image to preserve the state.<\/p>\n<p>Today, I fired up the image, reran the same code I tried yesterday.  It worked first time.  The setTags call succeeded.<\/p>\n<p>Hang on.  This is exactly the same world-state which I left yesterday, courtesy of smalltalk&#8217;s use of images.  Nothing has changed.  But suddenly it works.<\/p>\n<p>I&#8217;ve no idea why it didn&#8217;t work before, or why it suddenly started working.  Maybe flickr.com changed something on their site?  Regardless, it&#8217;s been an interesting lesson on how to debug problems when calling webservices, and an example of the potential for frustration when an API doesn&#8217;t work like you&#8217;re expecting, and there&#8217;s not enough information to understand why.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m writing a neat program which uses the flickr.com web services API. At first, I tried the python bindings but then I got frustrated with them. Python, whilst a pretty decent dynamically-typed language, feels like smalltalk without any of the good tools. So, since I&#8217;m writing this program for my own use, I ditched python [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-121","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/comments?post=121"}],"version-history":[{"count":0,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts\/121\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/media?parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/categories?post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/tags?post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}