<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Floorplanner Tech Blog &#187; http client</title>
	<atom:link href="http://techblog.floorplanner.com/tag/http-client/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.floorplanner.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 19 Nov 2009 04:00:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Debug your web service with HTTP Client</title>
		<link>http://techblog.floorplanner.com/2009/05/26/debug-your-web-service-with-http-client/</link>
		<comments>http://techblog.floorplanner.com/2009/05/26/debug-your-web-service-with-http-client/#comments</comments>
		<pubDate>Tue, 26 May 2009 09:51:42 +0000</pubDate>
		<dc:creator>Gert-Jan</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Floorplanner]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[http client]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=642</guid>
		<description><![CDATA[The last couple of weeks we&#8217;ve been working on a big integration project. The largest real estate portal of The Netherlands, Funda, uses Floorplanner to deliver interactive floor plans to their clients. They use our API&#8217;s to seamlessly integrate the Floorplanner into their back end system and front end website.
One of our API&#8217;s is our [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F05%2F26%2Fdebug-your-web-service-with-http-client%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F05%2F26%2Fdebug-your-web-service-with-http-client%2F" height="61" width="51" /></a></div><p>The last couple of weeks we&#8217;ve been working on a big integration project. The largest real estate portal of The Netherlands, <a href="http://www.funda.nl">Funda</a>, uses Floorplanner to deliver <a href="http://www.funda.nl/koop/dronten/huis-4217508-de-morinel-43-45/plattegrond/">interactive floor plans </a>to their clients. They use our API&#8217;s to seamlessly integrate the Floorplanner into their back end system and front end website.</p>
<p>One of our API&#8217;s is our RESTful web service. With it one can manage users, project, floors, designs etc. We set up a whole testing suite around it, but every now and then I wanted to test a single method by hand. For this I used the command line tool <a href="http://curl.haxx.se/">cURL</a> which looks something like this (getting all users):</p>

<div class="wp_syntax"><div class="code"><pre class="curl" style="font-family: Monaco,monospace;">curl -H &quot;Content-Type: application/xml&quot; 
-u &quot;username:password&quot; 
-X GET https://floorplanner.com/users.xml</pre></div></div>

<p>It works, but it&#8217;s kind of a hassle. One day <a href="https://twitter.com/whenyouneedmi">Michel</a> showed me <a href="http://ditchnet.org/httpclient/">HTTP Client</a>: </p>
<blockquote><p><i>A Mac OS X Leopard developer tool for debugging HTTP services by graphically creating &#038; inspecting complex HTTP messages.</i></p></blockquote>
<p>HTTP Client makes testing a web service by hand much easier. You can select any REST method you need from a pull down menu. Setting up your header is done by a few mouse clicks and the result is nicely formatted. </p>
<p><img src="http://techblog.floorplanner.com/wp-content/uploads/2009/05/afbeelding-1-600x421.png" alt="HTTP Client sample" title="HTTP Client sample" width="600" height="421" class="alignnone size-large wp-image-652" /></p>
<p>The only thing that didn&#8217;t seem to work out of the box was Basic HTTP Authentication. I found a workaround for this: add the authorization to the header myself. To do this use &#8220;Authorization&#8221; as header name. For the header value you have to encode the username and password with <a href="http://en.wikipedia.org/wiki/Base64">Base64</a> with a &#8220;:&#8221; as separator. For example in PHP: base64_encode(username:password). There are also a couple of websites around where you can encode a string to Base64. When you have the encoded string, you can add &#8220;Basic <i>encoded string here</i>&#8221; as a header value and you&#8217;re ready to roll.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2009/05/26/debug-your-web-service-with-http-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
