lib/gnip_api/request.rb in gnip_api-1.1.3 vs lib/gnip_api/request.rb in gnip_api-1.2.0
- old
+ new
@@ -2,11 +2,11 @@
class Request
attr_reader :uri, :payload, :headers, :request_method
class << self
def new_get uri, headers=nil
- new(:uri => uri, :headers => headers, :request_method => GnipApi::Adapter::GET, )
+ new(:uri => uri, :headers => headers, :request_method => GnipApi::Adapter::GET)
end
def new_post uri, payload, headers=nil
new(:uri => uri, :headers => headers, :payload => payload, :request_method => GnipApi::Adapter::POST)
end
@@ -20,7 +20,14 @@
@uri = params[:uri]
@payload = params[:payload]
@headers = params[:headers]
@request_method = params[:request_method]
end
+
+ def log!
+ GnipApi.logger.info "Starting #{request_method} request to #{uri}"
+ GnipApi.logger.debug "Headers -> #{headers.inspect}"
+ GnipApi.logger.debug "Payload -> #{payload.inspect}"
+ end
+
end
end