lib/motion-resource/requests.rb in motion-resource-0.0.1 vs lib/motion-resource/requests.rb in motion-resource-0.0.2
- old
+ new
@@ -44,12 +44,14 @@
url += query.map{|k,v| "#{k}=#{v}"}.join('&')
end
if self.default_url_options
options.merge!(self.default_url_options)
end
+ logger.log "#{method.upcase} #{complete_url(url)}"
BubbleWrap::HTTP.send(method, complete_url(url), options) do |response|
if response.ok?
body = response.body.to_str.strip rescue nil
+ logger.log "response: #{body}"
if body.blank?
block.call(response, {})
else
block.call response, BubbleWrap::JSON.parse(body)
end