From b52153f92cf9551446b0520d58d6c196250fe8ab Mon Sep 17 00:00:00 2001 From: Andy Brody Date: Wed, 24 May 2017 00:51:15 -0400 Subject: [PATCH] Add docs and change log for :stream_log_percent. --- history.md | 4 ++++ lib/restclient/request.rb | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/history.md b/history.md index 8eb79fd..1c1cfba 100644 --- a/history.md +++ b/history.md @@ -8,6 +8,10 @@ `log_response` a method on the Response object, and ensure the `size` method works on RawResponse objects. (#126) - `# => 200 OK | text/html 1270 bytes, 0.08s` + - Also add a new `:stream_log_percent` parameter, which is applicable only + when `:raw_response => true` is set. This causes progress logs to be + emitted only on every N% (default 10%) of the total download size rather + than on every chunk. - Drop custom handling of compression and use built-in Net::HTTP support for supported Content-Encodings like gzip and deflate. Don't set any explicit `Accept-Encoding` header, rely instead on Net::HTTP defaults. (#597) diff --git a/lib/restclient/request.rb b/lib/restclient/request.rb index 57e9c4f..5c78cc5 100644 --- a/lib/restclient/request.rb +++ b/lib/restclient/request.rb @@ -28,6 +28,11 @@ module RestClient # * :user and :password for basic auth, will be replaced by a user/password available in the :url # * :block_response call the provided block with the HTTPResponse as parameter # * :raw_response return a low-level RawResponse instead of a Response + # * :log Set the log for this request only, overriding RestClient.log, if + # any. + # * :stream_log_percent (Only relevant with :raw_response => true) Customize + # the interval at which download progress is logged. Defaults to every + # 10% complete. # * :max_redirects maximum number of redirections (default to 10) # * :proxy An HTTP proxy URI to use for this request. Any value here # (including nil) will override RestClient.proxy.