Method: Compliance::HTTP.post
- Defined in:
- lib/bundles/inspec-compliance/http.rb
.post(url, token, insecure, basic_auth = false) ⇒ Object
generic post request
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/bundles/inspec-compliance/http.rb', line 23 def self.post(url, token, insecure, basic_auth = false) # form request uri = _parse_url(url) req = Net::HTTP::Post.new(uri.path) if basic_auth req.basic_auth token, '' else req['Authorization'] = "Bearer #{token}" end req.form_data={} send_request(uri, req, insecure) end |