5
我的Rails应用程序有一个带有“name”属性的Post模型。我试图从iOS使用RestKit创建一个新的帖子。这是iOS代码。如何从Restkit + iOS到Rails进行POST
NSDictionary* params = [NSDictionary dictionaryWithObject:@"amazingname" forKey:@"name"];
[[RKClient sharedClient] post:@"/posts" params:params delegate:self];
而这里的同一台机器
Started POST "/posts" for 127.0.0.1 at Tue May 10 15:39:14 -0700 2011
Processing by PostsController#create as JSON
Parameters: {"name"=>"amazingname"}
MONGODB blog_development['posts'].insert([{"_id"=>BSON::ObjectId('4dc9be92be2eec614a000002')}])
Completed 406 Not Acceptable in 4ms
上运行的服务器日志正如你所看到的,服务器收到请求,但这个名字不会被保存到数据库中。一个无名的帖子被创建。我的iOS代码有什么问题?