【发布时间】:2014-02-19 16:04:29
【问题描述】:
如何使用 RestClient 在帖子中发送用户名和密码?我的客户端代码如下:
response = RestClient.post 'http://localhost:3000/api/rules',
:name => "me", :password => "12345",
:books => {:book_name => "Harry Porter",
:author => "JR"}
服务器代码在 Rails 中并使用 `http_basic_authenticate_with :name => "me", :password => "12345"。
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4 rest-client