# Simple Post to CookBook

**URL:** <https://www.ruby-forum.com/t/simple-post-to-cookbook/167731>\
**Category:** Rails\
**Created:** [May 12, 2009, 12:35am UTC](https://www.ruby-forum.com/t/simple-post-to-cookbook/167731 "2009-05-12T00:35:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sniper1694](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@sniper1694](https://www.ruby-forum.com/u/sniper1694)\
**Post date:** [May 12, 2009, 12:35am UTC](https://www.ruby-forum.com/t/simple-post-to-cookbook/167731/1 "2009-05-12T00:35:33Z")

</div>

I am trying to post from C# to a simple Ruby on Rails page.  
I am using the cookbook of Ruby on rails. So I just want to create a new  
category from C#  
I do it like this in c#

string url = “[http://localhost:3000/categories.xml](http://localhost:3000/categories.xml)”;  
oPostData = ASCIIEncoding.UTF8.GetBytes(“category=TestCat”);  
ie.Navigate2(ref oURL, ref oEmpty, ref oEmpty, ref oPostData, ref  
oHeader);

I get this

NoMethodError in CategoriesController#create  
undefined method `stringify\_keys!’ for “TestCat”:String  
RAILS\_ROOT: C:/InstantRails/rails\_apps/cookbook

C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/base.rb:2111:in  
`attributes=' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1926:in `initialize’  
app/controllers/categories\_controller.rb:43:in `new' app/controllers/categories_controller.rb:43:in `create’

Request  
Parameters:

{“format”=\>“xml”,  
“category”=\>“TestCat”}

Show session dump

* * *

:csrf\_id: 5dc6b3aa43b099703c798ea053ad9ebb  
flash: !map:ActionController::Flash::FlashHash {}

Response  
Headers:  
{“cookie”=\>[],  
“Cache-Control”=\>“no-cache”}

I think I am not supposed to pass the parameter that way. Can anybody  
show me where and how I am supposed to post on this. Any help will be  
appreciated .  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![sniper1694](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@sniper1694](https://www.ruby-forum.com/u/sniper1694)\
**Post date:** [May 12, 2009, 9:44am UTC](https://www.ruby-forum.com/t/simple-post-to-cookbook/167731/2 "2009-05-12T09:44:48Z")

</div>

I woudl suggest first you need to determine whether the problem is in  
the C#  
code or in the server.  
Have you looked in the rails log to see if the request being received by  
the  
server is as you expect?  
If so does that url work if you enter it from a browser?  
Colin

2009/5/11 Ridha B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
