Method: Saml::Util.post
- Defined in:
- lib/saml/util.rb
.post(location, message, additional_headers = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/saml/util.rb', line 17 def post(location, , additional_headers = {}) uri = URI.parse(location) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = uri.scheme == 'https' http.verify_mode = OpenSSL::SSL::VERIFY_PEER add_cacert_file(http) add_ssl_certificate_and_key(http) request = Net::HTTP::Post.new(uri.request_uri, merged_headers(additional_headers)) request.body = http.request(request) end |