Module: PostHTTPS

Defined in:
lib/incoming_webhook_notifier/post_https.rb

Class Method Summary collapse

Class Method Details

.call(url, hash_json) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/incoming_webhook_notifier/post_https.rb', line 6

def self.call(url, hash_json)
  uri = URI.parse(url)
  req = Net::HTTP::Post.new(uri.to_s)
  req.body = hash_json.to_json
  req['Content-Type'] = 'application/json'

  response = https(uri).request(req)

  response.body
end