# Help need with REST-ful httprequest/post

**URL:** <https://www.ruby-forum.com/t/help-need-with-rest-ful-httprequest-post/125971>\
**Category:** Rails\
**Created:** [January 14, 2008, 10:14am UTC](https://www.ruby-forum.com/t/help-need-with-rest-ful-httprequest-post/125971 "2008-01-14T10:14:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![petem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9e8a1a/32.png) [@petem](https://www.ruby-forum.com/u/petem)\
**Post date:** [January 14, 2008, 10:14am UTC](https://www.ruby-forum.com/t/help-need-with-rest-ful-httprequest-post/125971/1 "2008-01-14T10:14:09Z")

</div>

development.log extract …

Processing ClientsController#create (for 192.168.2.101 at 2008-01-14  
19:58:17) [POST]  
Session ID: 2258f3de2b013ddc9c46d861d917466a  
Parameters: {“waypoints”=\>“wp”, “action”=\>“create”,  
“landtitle”=\>“blah”, “controller”=\>“clients”, “owner”=\>“petem”}  
^[[4;36;1mSQL (0.000298)^[[0m ^[[0;1mSET SQL\_AUTO\_IS\_NULL=0^[[0m  
^[[4;35;1mClient Columns (0.046731)^[[0m ^[[0mSHOW FIELDS FROM  
clients^[[0m  
^[[4;36;1mSQL (0.000417)^[[0m ^[[0;1mBEGIN^[[0m  
^[[4;35;1mSQL (0.000529)^[[0m ^[[0mINSERT INTO clients  
(`waypoints`, `landtitle`, `owner`) VALUES(NULL, NULL, NULL)^[[0m  
^[[4;36;1mSQL (0.012764)^[[0m ^[[0;1mCOMMIT^[[0m  
Redirected to [http://www.wombatdreaming.com:3000/clients/60](http://www.wombatdreaming.com:3000/clients/60)  
Completed in 0.11676 (8 reqs/sec) | DB: 0.06074 (52%) | 302 Found  
[[http://www.wombatdreaming.com/clients](http://www.wombatdreaming.com/clients)]

I’m getting the behaviour above when I setup a simple little one table  
example (clients) and attempt to POST a HTTPRequest with this  
program …

use LWP::UserAgent;  
use URI::URL;

$hdrs = HTTP::Headers-\>new(Accept =\> ‘text/html’, User-Agent =\>  
‘MegaBrowser/1.0’);  
$url = URI::URL-\>new(‘[http://www.wombatdreaming.com:3000/clients](http://www.wombatdreaming.com:3000/clients)’);  
$req = HTTP::Request-\>new(POST, $url, $hdrs,  
“owner=petem&landtitle=blah&waypoints=wp”);  
$ua = LWP::UserAgent-\>new();  
$resp = $ua-\>request($req);  
if ($resp-\>is\_success) {  
print $resp-\>content;  
} else {  
print $resp-\>message;  
}

The parameters are being recognised but are NULLS trying to be  
inserted into the (string) fields? why? Now how do I debug this? Where  
can I see what the ActiveRecord base class is doing this for me? Or am  
I just drivng the request wrongly?

Thanks if you can help.
