Class: Raven::Transports::HTTP

Inherits:
Transport show all
Defined in:
lib/raven/transports/http.rb

Instance Attribute Summary

Attributes inherited from Transport

#configuration

Instance Method Summary collapse

Methods inherited from Transport

#initialize

Constructor Details

This class inherits a constructor from Raven::Transports::Transport

Instance Method Details

#send(auth_header, data, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/raven/transports/http.rb', line 10

def send(auth_header, data, options = {})
  project_id = self.configuration[:project_id]
  path = self.configuration[:path].gsub('/sentry', '') + "/"

  response = conn.post "#{path}api/#{project_id}/store/" do |req|
    req.headers['Content-Type'] = options[:content_type]
    req.headers['X-Sentry-Auth'] = auth_header
    req.body = data
  end
  Raven.logger.warn "Error from Sentry server (#{response.status}): #{response.body}" unless response.status == 200
end