<?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>Addictive Software &#187; rest</title>
	<atom:link href="http://blog.addictivesoftware.net/tag/rest/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.addictivesoftware.net</link>
	<description>ramblings of a chaotic mind</description>
	<lastBuildDate>Thu, 08 Dec 2011 16:08:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Lift by use case 4: getting a list of authors for the authenticated user</title>
		<link>http://blog.addictivesoftware.net/2011/06/lift-by-use-case-4-getting-a-list-of-authors-for-the-authenticated-user/</link>
		<comments>http://blog.addictivesoftware.net/2011/06/lift-by-use-case-4-getting-a-list-of-authors-for-the-authenticated-user/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 12:50:23 +0000</pubDate>
		<dc:creator>gertjan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Lift]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://blog.addictivesoftware.net/?p=207</guid>
		<description><![CDATA[As our website grows and people can log in, add books to their own collection, a need to access this collection on their mobile arises. When starting the mobile application and entered the correct login information, a request is being made to get the list of authors. Clicking on an author will get a list [...]]]></description>
			<content:encoded><![CDATA[<p>As our website grows and people can log in, add books to their own collection, a need to access this collection on their mobile arises.</p>
<p>When starting the mobile application and entered the correct login information, a request is being made to get the list of authors.<br />
Clicking on an author will get a list of books from that author that the user owns, clicking on a book shows the details.</p>
<p>So the first query that needs implementing is: Give me a list of Authors for which the current user owned books</p>
<p>Given the  Following Mapper Data Model:<br />
Author <- (1) -> Book <- (2) -> User<br />
(1) An Author can have more books while books can be written by multiple authors (N-N)<br />
(2) A user can own multiple books, while a book can have multiple owners  (N-N)</p>
<p>note: When successfully authenticating in a user his API key is returned which is used in all other requests </p>
<p>Below we will see the code that executes this query<br />
what happens line by line is this:</p>
<ul>
<li>Line4: we get a list of books for the current user</li>
<li>Line5: we map the colllection to one that contains the authors for each book, the result is a list of lists of authors List[List[Author]]</li>
<li>Line6: foldLeft applies the method to each element in the list, from left to right, as the method ++ means adding two list&#8217;s together, we&#8217;ll end up with one list containing all authors</li>
<li>Line7: distinct removes any duplicates in there</li>
<li>Line8: We sort the list on the author&#8217;s lastName property</li>
<li>Line9: we map it to a List of Xml fragments</li>
</ul>
<p>Scala&#8217;s inline XML support allows us to simple put the Authors tag around it.<br />
The second case does the same but gives a JSON response</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="scala" style="font-family:monospace;">serve <span style="color: #F78811;">&#123;</span>
  <span style="color: #0000ff; font-weight: bold;">case</span> <span style="color: #6666FF;">&quot;api&quot;</span> <span style="color: #000080;">::</span> key <span style="color: #000080;">::</span> <span style="color: #6666FF;">&quot;user&quot;</span> <span style="color: #000080;">::</span> <span style="color: #6666FF;">&quot;authors&quot;</span> <span style="color: #000080;">::</span> <span style="color: #6666FF;">&quot;all&quot;</span> <span style="color: #000080;">::</span> <span style="color: #000080;">_</span> XmlGet <span style="color: #000080;">_</span> <span style="color: #000080;">=&gt;</span> <span style="color: #F78811;">&#123;</span>
    <span style="color: #000080;">&lt;</span>Authors<span style="color: #000080;">&gt;</span> <span style="color: #F78811;">&#123;</span>
      Book.<span style="color: #000000;">findAll</span><span style="color: #F78811;">&#40;</span>In<span style="color: #F78811;">&#40;</span>Book.<span style="color: #000000;">id</span> ,BookUser.<span style="color: #000000;">book</span>, By<span style="color: #F78811;">&#40;</span>BookUser.<span style="color: #000000;">user</span>, getUserIdFromKey<span style="color: #F78811;">&#40;</span>key<span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span>
        .<span style="color: #000000;">map</span><span style="color: #F78811;">&#40;</span>book <span style="color: #000080;">=&gt;</span> <span style="color: #F78811;">&#123;</span> book.<span style="color: #000000;">authors</span>.<span style="color: #000000;">get</span> <span style="color: #F78811;">&#125;</span><span style="color: #F78811;">&#41;</span>
        .<span style="color: #000000;">foldLeft</span><span style="color: #F78811;">&#40;</span>List<span style="color: #F78811;">&#91;</span>Author<span style="color: #F78811;">&#93;</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#40;</span><span style="color: #000080;">_</span> ++ <span style="color: #000080;">_</span><span style="color: #F78811;">&#41;</span>
        .<span style="color: #000000;">distinct</span>
        .<span style="color: #000000;">sortWith</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#40;</span>a1<span style="color: #000080;">:</span>Author, a2<span style="color: #000080;">:</span>Author<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=&gt;</span> a1.<span style="color: #000000;">lastName</span>.<span style="color: #000000;">is</span> <span style="color: #000080;">&lt;</span> a2.<span style="color: #000000;">lastName</span>.<span style="color: #000000;">is</span><span style="color: #F78811;">&#41;</span>
        .<span style="color: #000000;">map</span><span style="color: #F78811;">&#40;</span>author <span style="color: #000080;">=&gt;</span> author.<span style="color: #000000;">toXml</span><span style="color: #F78811;">&#41;</span>
      <span style="color: #F78811;">&#125;</span>
    <span style="color: #000080;">&lt;</span>/Authors<span style="color: #000080;">&gt;</span>
  <span style="color: #F78811;">&#125;</span>
  <span style="color: #0000ff; font-weight: bold;">case</span> <span style="color: #6666FF;">&quot;api&quot;</span> <span style="color: #000080;">::</span> key <span style="color: #000080;">::</span> <span style="color: #6666FF;">&quot;user&quot;</span> <span style="color: #000080;">::</span> <span style="color: #6666FF;">&quot;authors&quot;</span> <span style="color: #000080;">::</span> <span style="color: #6666FF;">&quot;all&quot;</span> <span style="color: #000080;">::</span> <span style="color: #000080;">_</span> JsonGet <span style="color: #000080;">_</span> <span style="color: #000080;">=&gt;</span> <span style="color: #F78811;">&#123;</span>
    JsonWrapper <span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;Authors&quot;</span>, <span style="color: #F78811;">&#123;</span>
      Book.<span style="color: #000000;">findAll</span><span style="color: #F78811;">&#40;</span>In<span style="color: #F78811;">&#40;</span>Book.<span style="color: #000000;">id</span> ,BookUser.<span style="color: #000000;">book</span>, By<span style="color: #F78811;">&#40;</span>BookUser.<span style="color: #000000;">user</span>, getUserIdFromKey<span style="color: #F78811;">&#40;</span>key<span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span>
        .<span style="color: #000000;">map</span><span style="color: #F78811;">&#40;</span>book <span style="color: #000080;">=&gt;</span> <span style="color: #F78811;">&#123;</span> book.<span style="color: #000000;">authors</span>.<span style="color: #000000;">get</span> <span style="color: #F78811;">&#125;</span><span style="color: #F78811;">&#41;</span>
        .<span style="color: #000000;">foldLeft</span><span style="color: #F78811;">&#40;</span>List<span style="color: #F78811;">&#91;</span>Author<span style="color: #F78811;">&#93;</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#40;</span><span style="color: #000080;">_</span> ++ <span style="color: #000080;">_</span><span style="color: #F78811;">&#41;</span>
        .<span style="color: #000000;">distinct</span>
        .<span style="color: #000000;">sortWith</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#40;</span>a1<span style="color: #000080;">:</span>Author, a2<span style="color: #000080;">:</span>Author<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=&gt;</span> a1.<span style="color: #000000;">lastName</span>.<span style="color: #000000;">is</span> <span style="color: #000080;">&lt;</span> a2.<span style="color: #000000;">lastName</span>.<span style="color: #000000;">is</span><span style="color: #F78811;">&#41;</span>
        .<span style="color: #000000;">map</span><span style="color: #F78811;">&#40;</span>author <span style="color: #000080;">=&gt;</span> author.<span style="color: #000000;">toJson</span><span style="color: #F78811;">&#41;</span>
      <span style="color: #F78811;">&#125;</span><span style="color: #F78811;">&#41;</span>
  <span style="color: #F78811;">&#125;</span>
<span style="color: #F78811;">&#125;</span>
&nbsp;
<span style="color: #008000; font-style: italic;">//helper method</span>
<span style="color: #0000ff; font-weight: bold;">def</span> getUserIdFromKey<span style="color: #F78811;">&#40;</span>key<span style="color: #000080;">:</span>String<span style="color: #F78811;">&#41;</span><span style="color: #000080;">:</span>Long <span style="color: #000080;">=</span> <span style="color: #F78811;">&#123;</span>
  User.<span style="color: #000000;">find</span><span style="color: #F78811;">&#40;</span>By<span style="color: #F78811;">&#40;</span>User.<span style="color: #000000;">key</span>, key<span style="color: #F78811;">&#41;</span> <span style="color: #0000ff; font-weight: bold;">match</span> <span style="color: #F78811;">&#123;</span>
    <span style="color: #0000ff; font-weight: bold;">case</span> Full<span style="color: #F78811;">&#40;</span>user<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=&gt;</span> user.<span style="color: #000000;">id</span>
    <span style="color: #0000ff; font-weight: bold;">case</span> <span style="color: #F78811;">&#40;</span><span style="color: #000080;">_</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=&gt;</span> <span style="color: #F78811;">0</span> 
  <span style="color: #F78811;">&#125;</span>
<span style="color: #F78811;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.addictivesoftware.net/2011/06/lift-by-use-case-4-getting-a-list-of-authors-for-the-authenticated-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rest easy</title>
		<link>http://blog.addictivesoftware.net/2009/12/rest-easy/</link>
		<comments>http://blog.addictivesoftware.net/2009/12/rest-easy/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 14:10:09 +0000</pubDate>
		<dc:creator>gertjan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.addictivesoftware.net/?p=49</guid>
		<description><![CDATA[I’ve been playing around with REST (REpresentational State Transfer) for a bit and decided to write a small tutorial to show how easy it is to create a rest interface to your business objects Advantages of rest Works over HTTP, known protocol with known data formats (mime types), no weird ports open in your firewall [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been playing around with <a href="http://en.wikipedia.org/wiki/REST">REST</a> (REpresentational State Transfer) for a bit and decided to write a small tutorial to show how easy it is to create a rest interface to your business objects</p>
<p>Advantages of rest</p>
<ul>
<li>Works over HTTP, known protocol with known data formats (mime types), no weird ports open in your firewall</li>
<li>Every resource is uniquely identified by a URI</li>
<li>Can do CRUD on those resources (they are just called POST, GET, PUT, DELETE)</li>
<li>used by all the major players for cloud applications (<a href="http://kenai.com/projects/suncloudapis/pages/Home">SUN&#8217;s cloudApi</a>, <a href="http://www.microsoft.com/windowsazure/">Microsoft&#8217;s Azure services platform</a>)</li>
<li>we might finally get rid of webdav</li>
</ul>
<p>I&#8217;ll be using the <a href="https://jersey.dev.java.net/">Jersey</a> Framework for this.<br />
As i’ve been working on a backend that will allow you to manage <a href="http://en.wikipedia.org/wiki/Agile_development">agile development</a> processes (Scrum, Kanban etc) I thought I use that.</p>
<p>In this application every object is represented by a Card for instance a Story, Task, Bug, work Item, etc.<br />
Cards have a hierarchical structure and can each have custom properties<br />
The class looks something like this (removed methods for clarity):</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000000; font-weight: bold;">class</span> Card <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">long</span> id<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">List</span> children <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">List</span> properties <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>and then for instance the Story class with some default values set in the constructor:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Story <span style="color: #000000; font-weight: bold;">extends</span> Card <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> Story<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		addProperty<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Title&quot;</span>, <span style="color: #0000ff;">&quot;A new story&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		addProperty<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Description&quot;</span>, <span style="color: #0000ff;">&quot;as a .. I want .. for the benefit of ..&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		addProperty<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Storypoints&quot;</span>, <span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>To be able to return these objects through REST they need to be in a format that can be distributed over HTTP, in this case we will be using XML and JSON.<br />
The <a href="https://jaxb.dev.java.net/">Java XML Bindings</a> are perfectly suited to create xml representations of our classes</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@XmlRootElement<span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;card&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000000; font-weight: bold;">class</span> Card <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">long</span> id<span style="color: #339933;">;</span>
&nbsp;
	@XmlAttribute<span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;type&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #003399;">String</span> instance <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getSimpleName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	@XmlElement<span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;card&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">List</span> children <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	@XmlElement<span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;property&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">List</span> properties <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	@XmlAttribute
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">long</span> getId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>* the Entry class is a simple class with a name and value property, I choose this approach as JAXB has an issue in representing HashMaps() in XML<br />
this will produce the following xml</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;</pre></div></div>

<p>for JSON we don’t need to do anything special then include the jersey-json.jar to the project.</p>
<p>Now to configure and hookup the rest servlet<br />
I added the jersey servlet to my web.xml</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    	Rest Web Service
    	com.sun.jersey.spi.container.servlet.ServletContainer
    	1
&nbsp;
    	Rest Web Service
    	/services/*</pre></div></div>

<p>And create the service provider class</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@PerRequest
@Path<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/agileassistant&quot;</span><span style="color: #009900;">&#41;</span>
@Consumes<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> MediaType.<span style="color: #006633;">APPLICATION_JSON</span>, MediaType.<span style="color: #006633;">APPLICATION_XML</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
@Produces<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> MediaType.<span style="color: #006633;">APPLICATION_JSON</span>, MediaType.<span style="color: #006633;">APPLICATION_XML</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AgileAssistantService <span style="color: #009900;">&#123;</span>
 ...
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This will tell Jersey that this is a provider that will respond to requests to /rest/agileassistant, accept JSON and XML and can output JSON or XML depending on the accept headers sent by the client</p>
<p>Now if we for instance want to return the first card (rootCard) and all its children we add this method</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> Card rootCard <span style="color: #339933;">=</span> Card.<span style="color: #006633;">createCard</span><span style="color: #009900;">&#40;</span>Root.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	@GET
	<span style="color: #000000; font-weight: bold;">public</span> Card getRoot<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> rootCard<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>(in my data model the rootCard is always present and functions as a starting point to add the rest of the cards in a hierarchical structure)<br />
So requesting this card will effectively return the entire structure for my test data:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;</pre></div></div>

<p>Doing a parameterized query is almost as easy</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">	@GET
	@Path<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/card/{id}&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">public</span> Card getCard<span style="color: #009900;">&#40;</span>@PathParam<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">long</span> id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> getCardById<span style="color: #009900;">&#40;</span>rootCard, id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>here the id that you specify will be injected into the parameter<br />
giving the following output</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;</pre></div></div>

<p>To conclude enabling rest for your applications is pretty easy, writing this blog took longer than writing the code.<br />
In a next post I will add POST/PUT/DELETE requests to store data in your application</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.addictivesoftware.net/2009/12/rest-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

