Method: Faultline::SyncSender#build_post_request

Defined in:
lib/faultline/sync_sender.rb

#build_post_request(uri, notice) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/faultline/sync_sender.rb', line 3

def build_post_request(uri, notice)
  Net::HTTP::Post.new(uri.request_uri).tap do |req|
    req.body = notice.to_json

    req['Content-Type'] = CONTENT_TYPE
    req['X-Api-Key'] = @config.api_key
    req['User-Agent'] =
      "#{Faultline::Notice::NOTIFIER[:name]}/#{Faultline::VERSION}" \
      " Ruby/#{RUBY_VERSION}"
  end
end