<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Getting data into a Sinatra Application</title>
	<atom:link href="http://www.gittr.com/index.php/archive/getting-data-into-a-sinatra-application/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gittr.com/index.php/archive/getting-data-into-a-sinatra-application/</link>
	<description>eval("eval(\"eval(\\\"puts 'a ruby weblog'\\\")\")")</description>
	<lastBuildDate>Mon, 30 Aug 2010 18:42:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: admin</title>
		<link>http://www.gittr.com/index.php/archive/getting-data-into-a-sinatra-application/comment-page-1/#comment-326</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 28 Mar 2010 19:23:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=33#comment-326</guid>
		<description>Yeah, both useful, but slightly different.</description>
		<content:encoded><![CDATA[<p>Yeah, both useful, but slightly&nbsp;different.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juvenn Woo</title>
		<link>http://www.gittr.com/index.php/archive/getting-data-into-a-sinatra-application/comment-page-1/#comment-325</link>
		<dc:creator>Juvenn Woo</dc:creator>
		<pubDate>Sat, 27 Mar 2010 17:01:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=33#comment-325</guid>
		<description>You right, Chris.

`request.body.read` is the recommended way to get the request payload.

I guess `request.POST` parse the payload according to request header `content-type`. Say if it is x-www-form-urlencoded, then POST() will return a hash.</description>
		<content:encoded><![CDATA[<p>You right,&nbsp;Chris.</p>
<p>`request.body.read` is the recommended way to get the request&nbsp;payload.</p>
<p>I guess `request.<span class="caps">POST</span>` parse the payload according to request header `content-type`. Say if it is x-www-form-urlencoded, then <span class="caps">POST</span>() will return a&nbsp;hash.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.gittr.com/index.php/archive/getting-data-into-a-sinatra-application/comment-page-1/#comment-322</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 19 Mar 2010 15:56:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=33#comment-322</guid>
		<description>From my reading of the code, .body and .POST() are different.  .body gives you exactly the content of the request, while POST does various parsing.  

In fact, it looks like Sinatra uses POST() internally to get the params[] object setup right.  http://github.com/sinatra/sinatra/blob/master/lib/sinatra/base.rb#L41</description>
		<content:encoded><![CDATA[<p>From my reading of the code, .body and .<span class="caps">POST</span>() are different.  .body gives you exactly the content of the request, while <span class="caps">POST</span> does various&nbsp;parsing.  </p>
<p>In fact, it looks like Sinatra uses <span class="caps">POST</span>() internally to get the params[] object setup right.&nbsp;<a href="http://github.com/sinatra/sinatra/blob/master/lib/sinatra/base.rb#L41" rel="nofollow">http://github.com/sinatra/sinatra/blob/master/lib/sinatra/base.rb#L41</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juvenn Woo</title>
		<link>http://www.gittr.com/index.php/archive/getting-data-into-a-sinatra-application/comment-page-1/#comment-321</link>
		<dc:creator>Juvenn Woo</dc:creator>
		<pubDate>Fri, 19 Mar 2010 15:49:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=33#comment-321</guid>
		<description>In latest pre 1.0 release, the last example maybe:

request.POST()

http://rack.rubyforge.org/doc/classes/Rack/Request.html#M000224</description>
		<content:encoded><![CDATA[<p>In latest pre 1.0 release, the last example&nbsp;maybe:</p>
<p>request.<span class="caps">POST</span>()</p>
<p><a href="http://rack.rubyforge.org/doc/classes/Rack/Request.html#M000224" rel="nofollow">http://rack.rubyforge.org/doc/classes/Rack/Request.html#M000224</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cschneid</title>
		<link>http://www.gittr.com/index.php/archive/getting-data-into-a-sinatra-application/comment-page-1/#comment-17</link>
		<dc:creator>cschneid</dc:creator>
		<pubDate>Mon, 16 Jun 2008 02:41:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=33#comment-17</guid>
		<description>Your right, you should be able to skip the env call.

To keep it the same as my original example, it would be: request.body.read.</description>
		<content:encoded><![CDATA[<p>Your right, you should be able to skip the env&nbsp;call.</p>
<p>To keep it the same as my original example, it would be:&nbsp;request.body.read.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Wiggins</title>
		<link>http://www.gittr.com/index.php/archive/getting-data-into-a-sinatra-application/comment-page-1/#comment-16</link>
		<dc:creator>Adam Wiggins</dc:creator>
		<pubDate>Mon, 16 Jun 2008 01:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=33#comment-16</guid>
		<description>A slightly shorter version of the last example: raw = request.body.string</description>
		<content:encoded><![CDATA[<p>A slightly shorter version of the last example: raw =&nbsp;request.body.string</p>
]]></content:encoded>
	</item>
</channel>
</rss>
