<?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>All Thumbs and No Fingers &#187; rest</title>
	<atom:link href="http://redjamjar.net/tags/rest/feed/" rel="self" type="application/rss+xml" />
	<link>http://redjamjar.net</link>
	<description>A bucket for all things by redjamjar</description>
	<lastBuildDate>Thu, 12 Apr 2012 06:05:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Rails &#8211; speaking REST as a mock webservice</title>
		<link>http://redjamjar.net/internet/rails-speaking-to-rest-as-a-mock-webservice/</link>
		<comments>http://redjamjar.net/internet/rails-speaking-to-rest-as-a-mock-webservice/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 11:03:44 +0000</pubDate>
		<dc:creator>Mojo</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://2thumbs.wordpress.com/?p=52</guid>
		<description><![CDATA[Finally understood the distinctions between webservices and rest. Now I don&#8217;t mean the theory aspects Roy Fieldings paper adequately explains the concepts and frankly helps a great deal to try to introduce technology which is along the lines of &#8216;less &#8230; <a href="http://redjamjar.net/internet/rails-speaking-to-rest-as-a-mock-webservice/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Finally understood the distinctions between webservices and rest. Now I don&#8217;t mean the theory aspects Roy Fieldings paper adequately explains the concepts and frankly helps a great deal to try to introduce technology which is along the lines of &#8216;less is more&#8217;.</p>
<p><span id="more-53"></span>What I mean is being able to create a service mock up a test script and talk to the server using XML.</p>
<p>Here is an example of creating a new Person:<br />
<code><br />
require 'net/http'</code></p>
<p><code>s = &lt;&lt;-XML</p>
<p>Sarah<br />
Jhummun</p>
<p>XML</p>
<p>Net::HTTP.start('localhost', 3000) do |http|<br />
response = http.post('/people.xml', "#{s}", 'Content-Type' =&gt; 'text/xml')</p>
<p>#Do something with the response.</p>
<p></code></p>
<p><code> puts "Code: #{response.code}"<br />
puts "Message: #{response.message}"<br />
puts "Body:\n #{response.body}"<br />
end<br />
</code></p>
<p>and here is an example of retrieving a list of people:<br />
<code><br />
require 'net/http'</code></p>
<p><code>Net::HTTP.start('localhost', 3000) do |http|<br />
response = http.get('/people/', 'Accept' =&gt; 'text/xml')</p>
<p>#Do something with the response.</p>
<p></code></p>
<p><code> puts "Code: #{response.code}"<br />
puts "Message: #{response.message}"<br />
puts "Body:\n #{response.body}"<br />
end<br />
</code></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Rails+%E2%80%93+speaking+REST+as+a+mock+webservice+http%3A%2F%2Fbit.ly%2FvXcdWe" title="Post to Twitter"><img class="nothumb" src="http://redjamjar.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Rails+%E2%80%93+speaking+REST+as+a+mock+webservice+http%3A%2F%2Fbit.ly%2FvXcdWe" title="Post to Twitter">Tweet This Post</a></p></div><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://redjamjar.net/internet/rails-speaking-to-rest-as-a-mock-webservice/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: redjamjar.net @ 2012-05-22 10:10:42 -->
