Class: Net::HTTP
- Inherits:
-
Object
- Object
- Net::HTTP
- Defined in:
- lib/fusebox/core_ext/net_http.rb
Class Method Summary collapse
-
.post_form_with_ssl(url, params) ⇒ Object
Posts HTML form data to the URL, but allow for SSL.
Class Method Details
.post_form_with_ssl(url, params) ⇒ Object
Posts HTML form data to the URL, but allow for SSL.
The existing 1.8.x implementaiton via post_form does not allow for SSL connections
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/fusebox/core_ext/net_http.rb', line 9 def HTTP.post_form_with_ssl(url, params) req = Post.new(url.path) req.form_data = params req.basic_auth url.user, url.password if url.user http = new(url.host, url.port) http.use_ssl = (url.scheme == 'https') http.verify_mode = OpenSSL::SSL::VERIFY_PEER http.ca_file = File.('../../../../vendor/curl-cacert.pem', __FILE__) http.start {|http| http.request(req) } end |