Kong / unirest-ruby

Unirest in Ruby: Simplified, lightweight HTTP client library.
http://unirest.io/ruby
MIT License
364 stars 81 forks source link

Gem: POST method needs "body" rather then "parameters" parameter #53

Open daniel-sullivan opened 5 years ago

daniel-sullivan commented 5 years ago

After being unsuccessful in doing a POST request as per the documentation I dug into the code in the current version of the gem on rubygems (unirest-1.0.8) and discovered that while the documentation states that the post method takes a "parameters" parameter with the POST body, the actual method is expecting a "body" parameter.

  def self.post(url, headers = {}, body = nil, &callback)
    return HttpClient.request(:post, url, headers, body, &callback)
  end