diff --git a/lib/httparty/logger/curl_logger.rb b/lib/httparty/logger/curl_logger.rb index c024dabf..6fef2909 100644 --- a/lib/httparty/logger/curl_logger.rb +++ b/lib/httparty/logger/curl_logger.rb @@ -23,7 +23,7 @@ def format(request, response) end end - print_outgoing request.raw_request.body if request.raw_request && request.raw_request.body + print_outgoing request.raw_body print_outgoing "" print_incoming "HTTP/#{response.http_version} #{response.code}" diff --git a/lib/httparty/request.rb b/lib/httparty/request.rb index efffd6d0..a05f80ba 100644 --- a/lib/httparty/request.rb +++ b/lib/httparty/request.rb @@ -27,7 +27,7 @@ class Request #:nodoc: end attr_accessor :http_method, :options, :last_response, :redirect, :last_uri - attr_reader :path, :raw_request + attr_reader :path def initialize(http_method, path, o={}) self.http_method = http_method @@ -107,6 +107,10 @@ def perform(&block) handle_response(chunked_body, &block) end + def raw_body + @raw_request.body + end + private def http