Method: CouchObject::Server#post

Defined in:
lib/couch_object/server.rb

#post(path, data, content_type = "application/json") ⇒ Object

Send a POST request to path with the body payload of data content_type is the Content-Type header to send along (defaults to application/json)



24
25
26
27
28
29
# File 'lib/couch_object/server.rb', line 24

def post(path, data, content_type="application/json")
  post = Net::HTTP::Post.new(path)
  post["content-type"] = content_type
  post.body = data
  request(post)      
end