lib/onyphe/client.rb in onyphe-1.0.0 vs lib/onyphe/client.rb in onyphe-1.1.0
- old
+ new
@@ -54,7 +54,16 @@
url.query = URI.encode_www_form(params)
get = Net::HTTP::Get.new(url)
request(get, &block)
end
+
+ def post(path, params = {}, &block)
+ url = url_for(path)
+
+ post = Net::HTTP::Post.new(url)
+ post.set_form_data params
+ post["Authorization"] = "apikey #{@api_key}"
+ request(post, &block)
+ end
end
end