Method: HTTParty::ClassMethods#post

Defined in:
lib/httparty.rb

#post(path, options = {}, &block) ⇒ Object

Allows making a post request to a url.

class Foo
  include HTTParty
end

# Simple post with full url and setting the body
Foo.post('http://foo.com/resources', body: {bar: 'baz'})

# Simple post with full url using :query option,
# which gets set as form data on the request.
Foo.post('http://foo.com/resources', query: {bar: 'baz'})


472
473
474
# File 'lib/httparty.rb', line 472

def post(path, options={}, &block)
  perform_request Net::HTTP::Post, path, options, &block
end