Created
November 28, 2008 03:33
-
-
Save wtnabe/29892 to your computer and use it in GitHub Desktop.
A rest-client's patch for zero byte response body. Now no longer required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| index 1bf1d10..3716dee 100644 | |
| --- a/lib/rest_client.rb | |
| +++ b/lib/rest_client.rb | |
| @@ -228,7 +228,7 @@ module RestClient | |
| end | |
| def response_log(res) | |
| - "# => #{res.code} #{res.class.to_s.gsub(/^Net::HTTP/, '')} | #{(res['Content-type'] || '').gsub(/;.*$/, '')} #{res.body.size} bytes" | |
| + "# => #{res.code} #{res.class.to_s.gsub(/^Net::HTTP/, '')} | #{(res['Content-type'] || '').gsub(/;.*$/, '')} #{res.body ? res.body.size : 0} bytes" | |
| end | |
| def display_log(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment