我在 ruby 中使用 Rest-client gem。我的代码如下..,
require 'rest_client'
puts RestClient.get 'http://localhost:3000/articles'
puts RestClient.put 'http://localhost:3000/', {:params => {:Bat => 'ball'}}
RestClient.post 'http://localhost:3000/articles', {:params => {:Name => 'list1', 'Content' => 'Article1'}}
我引用了在 rails 应用程序中运行的 URL,用户可以使用上面的 url 创建、删除、编辑、列出文章。对于 put、delete、post、get 方法,它会在我的提示中生成 URL 的 html 代码。但是它无法通过 ruby 代码从列表中插入帖子/删除项目。在 RestClient 中可以吗?