11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/rnotifier/notifier.rb', line 11
def send(data, path)
response = self.connection.post do |req|
req.url(path)
req.['Content-Type'] = 'application/json'
req.['Api-Key'] = Config.api_key
req.options[:timeout] = Config[:http_open_timeout]
req.options[:open_timeout] = Config[:http_read_timeout]
req.body = MultiJson.dump(data)
end
return true if response.status == 200
Rlogger.error("[RNOTIFIER SERVER] Response Status:#{response.status}")
false
ensure
Rnotifier.clear_context
end
|