juretta.com

Rails WDDX request

January 31, 2007
Rails Ruby WDDX

I was asked how to get the body of an HTTP post request in a Rails controller. And with the most things in Rails it's very easy.

In Java you can get a ServletInputStream from the request object, in PHP there is $_SERVER['RAW_POST_DATA']. Pretty much like in the java version you can just ask the request object for raw_post in Rails.

To test this controller you can use the following code to issue a post request.


About

This is the defunct blog of Stefan Saasen.

Ads