Method: Bixby::HttpClient#http_post

Defined in:
lib/bixby-common/util/http_client.rb

#http_post(url, data) ⇒ String

Execute an HTTP POST request to the given URL

Parameters:

  • url (String)
  • data (Hash)

    Key/Value pairs to POST

Returns:

  • (String)

    Contents of the response’s body



34
35
36
37
# File 'lib/bixby-common/util/http_client.rb', line 34

def http_post(url, data)
  req = HTTPI::Request.new(:url => url, :body => data)
  return HTTPI.post(req).body
end