使用httparty发出请求时500服务器错误

时间:2015-10-27 20:35:56

标签: ruby-on-rails ruby request http-post httparty

我尝试使用httparty重现以下请求:

curl --verbose --data '{"username":"my_user@mail.com", "password":"my_password"}' http://my_page/api/user/authenticate

这就是我正在做的事情:

class RequestParty
  include HTTParty

  def initialize(base_uri)
    self.class.base_uri base_uri
  end

  def post(endpoint, options)
    self.class.post(endpoint, options)
  end
end

RequestParty.new("http://my_page/api").post("/user/authenticate",{"username" => "my_user@mail.com", "password" =>"my_password"})

但我不断获得500 Internal Server Error

我做错了吗?

0 个答案:

没有答案