Module: Ethon::Easy::Http

Defined in:
lib/httplog/adapters/ethon.rb

Instance Method Summary collapse

Instance Method Details

#http_request(url, action_name, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/httplog/adapters/ethon.rb', line 10

def http_request(url, action_name, options = {})
  @action_name = action_name # remember this for compact logging
  if HttpLog.url_approved?(url)
    HttpLog.log_request(action_name, url)
    HttpLog.log_headers(options[:headers])
    HttpLog.log_data(options[:body]) # if action_name == :post
  end

  orig_http_request(url, action_name, options)
end

#orig_http_requestObject



9
# File 'lib/httplog/adapters/ethon.rb', line 9

alias orig_http_request http_request