rest-client 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/.rspec +2 -0
  4. data/.rubocop-disables.yml +384 -0
  5. data/.rubocop.yml +3 -0
  6. data/.travis.yml +48 -0
  7. data/AUTHORS +98 -0
  8. data/Gemfile +11 -0
  9. data/LICENSE +21 -0
  10. data/README.md +784 -0
  11. data/Rakefile +132 -0
  12. data/bin/restclient +92 -0
  13. data/history.md +324 -0
  14. data/lib/rest-client.rb +2 -0
  15. data/lib/rest_client.rb +2 -0
  16. data/lib/restclient.rb +184 -0
  17. data/lib/restclient/abstract_response.rb +226 -0
  18. data/lib/restclient/exceptions.rb +244 -0
  19. data/lib/restclient/params_array.rb +72 -0
  20. data/lib/restclient/payload.rb +209 -0
  21. data/lib/restclient/platform.rb +49 -0
  22. data/lib/restclient/raw_response.rb +38 -0
  23. data/lib/restclient/request.rb +853 -0
  24. data/lib/restclient/resource.rb +168 -0
  25. data/lib/restclient/response.rb +80 -0
  26. data/lib/restclient/utils.rb +235 -0
  27. data/lib/restclient/version.rb +8 -0
  28. data/lib/restclient/windows.rb +8 -0
  29. data/lib/restclient/windows/root_certs.rb +105 -0
  30. data/rest-client.gemspec +31 -0
  31. data/rest-client.windows.gemspec +19 -0
  32. data/spec/helpers.rb +22 -0
  33. data/spec/integration/_lib.rb +1 -0
  34. data/spec/integration/capath_digicert/244b5494.0 +19 -0
  35. data/spec/integration/capath_digicert/81b9768f.0 +19 -0
  36. data/spec/integration/capath_digicert/README +8 -0
  37. data/spec/integration/capath_digicert/digicert.crt +19 -0
  38. data/spec/integration/capath_verisign/415660c1.0 +14 -0
  39. data/spec/integration/capath_verisign/7651b327.0 +14 -0
  40. data/spec/integration/capath_verisign/README +8 -0
  41. data/spec/integration/capath_verisign/verisign.crt +14 -0
  42. data/spec/integration/certs/digicert.crt +19 -0
  43. data/spec/integration/certs/verisign.crt +14 -0
  44. data/spec/integration/httpbin_spec.rb +87 -0
  45. data/spec/integration/integration_spec.rb +125 -0
  46. data/spec/integration/request_spec.rb +127 -0
  47. data/spec/spec_helper.rb +29 -0
  48. data/spec/unit/_lib.rb +1 -0
  49. data/spec/unit/abstract_response_spec.rb +145 -0
  50. data/spec/unit/exceptions_spec.rb +108 -0
  51. data/spec/unit/master_shake.jpg +0 -0
  52. data/spec/unit/params_array_spec.rb +36 -0
  53. data/spec/unit/payload_spec.rb +263 -0
  54. data/spec/unit/raw_response_spec.rb +18 -0
  55. data/spec/unit/request2_spec.rb +54 -0
  56. data/spec/unit/request_spec.rb +1250 -0
  57. data/spec/unit/resource_spec.rb +134 -0
  58. data/spec/unit/response_spec.rb +241 -0
  59. data/spec/unit/restclient_spec.rb +79 -0
  60. data/spec/unit/utils_spec.rb +147 -0
  61. data/spec/unit/windows/root_certs_spec.rb +22 -0
  62. metadata +282 -0
@@ -0,0 +1,132 @@
1
+ # load `rake build/install/release tasks'
2
+ require 'bundler/setup'
3
+ require_relative './lib/restclient/version'
4
+
5
+ namespace :ruby do
6
+ Bundler::GemHelper.install_tasks(:name => 'rest-client')
7
+ end
8
+
9
+ require "rspec/core/rake_task"
10
+
11
+ desc "Run all specs"
12
+ RSpec::Core::RakeTask.new('spec')
13
+
14
+ desc "Run unit specs"
15
+ RSpec::Core::RakeTask.new('spec:unit') do |t|
16
+ t.pattern = 'spec/unit/*_spec.rb'
17
+ end
18
+
19
+ desc "Run integration specs"
20
+ RSpec::Core::RakeTask.new('spec:integration') do |t|
21
+ t.pattern = 'spec/integration/*_spec.rb'
22
+ end
23
+
24
+ desc "Print specdocs"
25
+ RSpec::Core::RakeTask.new(:doc) do |t|
26
+ t.rspec_opts = ["--format", "specdoc", "--dry-run"]
27
+ t.pattern = 'spec/**/*_spec.rb'
28
+ end
29
+
30
+ desc "Run all examples with RCov"
31
+ RSpec::Core::RakeTask.new('rcov') do |t|
32
+ t.pattern = 'spec/*_spec.rb'
33
+ t.rcov = true
34
+ t.rcov_opts = ['--exclude', 'examples']
35
+ end
36
+
37
+ desc 'Regenerate authors file'
38
+ task :authors do
39
+ Dir.chdir(File.dirname(__FILE__)) do
40
+ File.open('AUTHORS', 'w') do |f|
41
+ f.write( <<-EOM
42
+ The Ruby REST Client would not be what it is today without the help of
43
+ the following kind souls:
44
+
45
+ EOM
46
+ )
47
+ end
48
+
49
+ sh 'git shortlog -s | cut -f 2 >> AUTHORS'
50
+ end
51
+ end
52
+
53
+ task :default do
54
+ sh 'rake -T'
55
+ end
56
+
57
+ def alias_task(alias_task, original)
58
+ desc "Alias for rake #{original}"
59
+ task alias_task, Rake.application[original].arg_names => original
60
+ end
61
+ alias_task(:test, :spec)
62
+
63
+ ############################
64
+
65
+ WindowsPlatforms = %w{x86-mingw32 x64-mingw32 x86-mswin32}
66
+
67
+ namespace :all do
68
+
69
+ desc "Build rest-client #{RestClient::VERSION} for all platforms"
70
+ task :build => ['ruby:build'] + \
71
+ WindowsPlatforms.map {|p| "windows:#{p}:build"}
72
+
73
+ desc "Create tag v#{RestClient::VERSION} and for all platforms build and push " \
74
+ "rest-client #{RestClient::VERSION} to Rubygems"
75
+ task :release => ['build', 'ruby:release'] + \
76
+ WindowsPlatforms.map {|p| "windows:#{p}:push"}
77
+
78
+ end
79
+
80
+ namespace :windows do
81
+ spec_path = File.join(File.dirname(__FILE__), 'rest-client.windows.gemspec')
82
+
83
+ WindowsPlatforms.each do |platform|
84
+ namespace platform do
85
+ gem_filename = "rest-client-#{RestClient::VERSION}-#{platform}.gem"
86
+ base = File.dirname(__FILE__)
87
+ pkg_dir = File.join(base, 'pkg')
88
+ gem_file_path = File.join(pkg_dir, gem_filename)
89
+
90
+ desc "Build #{gem_filename} into the pkg directory"
91
+ task 'build' do
92
+ orig_platform = ENV['BUILD_PLATFORM']
93
+ begin
94
+ ENV['BUILD_PLATFORM'] = platform
95
+
96
+ sh("gem build -V #{spec_path}") do |ok, res|
97
+ if ok
98
+ FileUtils.mkdir_p(pkg_dir)
99
+ FileUtils.mv(File.join(base, gem_filename), pkg_dir)
100
+ Bundler.ui.confirm("rest-client #{RestClient::VERSION} " \
101
+ "built to pkg/#{gem_filename}")
102
+ else
103
+ abort "Command `gem build` failed: #{res}"
104
+ end
105
+ end
106
+
107
+ ensure
108
+ ENV['BUILD_PLATFORM'] = orig_platform
109
+ end
110
+ end
111
+
112
+ desc "Push #{gem_filename} to Rubygems"
113
+ task 'push' do
114
+ sh("gem push #{gem_file_path}")
115
+ end
116
+ end
117
+ end
118
+
119
+ end
120
+
121
+ ############################
122
+
123
+ require 'rdoc/task'
124
+
125
+ Rake::RDocTask.new do |t|
126
+ t.rdoc_dir = 'rdoc'
127
+ t.title = "rest-client, fetch RESTful resources effortlessly"
128
+ t.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
129
+ t.options << '--charset' << 'utf-8'
130
+ t.rdoc_files.include('README.md')
131
+ t.rdoc_files.include('lib/*.rb')
132
+ end
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
4
+
5
+ require 'rubygems'
6
+ require 'restclient'
7
+ require 'yaml'
8
+
9
+ def usage(why = nil)
10
+ puts "failed for reason: #{why}" if why
11
+ puts "usage: restclient [get|put|post|delete] url|name [username] [password]"
12
+ puts " The verb is optional, if you leave it off you'll get an interactive shell."
13
+ puts " put and post both take the input body on stdin."
14
+ exit(1)
15
+ end
16
+
17
+ POSSIBLE_VERBS = ['get', 'put', 'post', 'delete']
18
+
19
+ if POSSIBLE_VERBS.include? ARGV.first
20
+ @verb = ARGV.shift
21
+ else
22
+ @verb = nil
23
+ end
24
+
25
+ @url = ARGV.shift || 'http://localhost:4567'
26
+
27
+ config = YAML.load(File.read(ENV['HOME'] + "/.restclient")) rescue {}
28
+
29
+ if (c = config[@url])
30
+ @url, @username, @password = [c['url'], c['username'], c['password']]
31
+ else
32
+ @url, @username, @password = [@url, * ARGV]
33
+ end
34
+
35
+ usage("invalid url '#{@url}") unless @url =~ /^https?/
36
+ usage("too few args") unless ARGV.size < 3
37
+
38
+ def r
39
+ @r ||= RestClient::Resource.new(@url, @username, @password)
40
+ end
41
+
42
+ r # force rc to load
43
+
44
+ if @verb
45
+ begin
46
+ if %w( put post ).include? @verb
47
+ puts r.send(@verb, STDIN.read)
48
+ else
49
+ puts r.send(@verb)
50
+ end
51
+ exit 0
52
+ rescue RestClient::Exception => e
53
+ puts e.response.body if e.respond_to?(:response) && e.response
54
+ raise
55
+ end
56
+ end
57
+
58
+ POSSIBLE_VERBS.each do |m|
59
+ define_method(m.to_sym) do |path, *args, &b|
60
+ r[path].public_send(m.to_sym, *args, &b)
61
+ end
62
+ end
63
+
64
+ def method_missing(s, * args, & b)
65
+ if POSSIBLE_VERBS.include? s
66
+ begin
67
+ r.send(s, *args, & b)
68
+ rescue RestClient::RequestFailed => e
69
+ print STDERR, e.response.body
70
+ raise e
71
+ end
72
+ else
73
+ super
74
+ end
75
+ end
76
+
77
+ require 'irb'
78
+ require 'irb/completion'
79
+
80
+ if File.exist? ".irbrc"
81
+ ENV['IRBRC'] = ".irbrc"
82
+ end
83
+
84
+ rcfile = File.expand_path("~/.restclientrc")
85
+ if File.exist?(rcfile)
86
+ load(rcfile)
87
+ end
88
+
89
+ ARGV.clear
90
+
91
+ IRB.start
92
+ exit!
@@ -0,0 +1,324 @@
1
+ # 2.0.2
2
+
3
+ - Suppress the header override warning introduced in 2.0.1 if the value is the
4
+ same. There's no conflict if the value is unchanged. (#578)
5
+
6
+ # 2.0.1
7
+
8
+ - Warn if auto-generated headers from the payload, such as Content-Type,
9
+ override headers set by the user. This is usually not what the user wants to
10
+ happen, and can be surprising. (#554)
11
+ - Drop the old check for weak default TLS ciphers, and use the built-in Ruby
12
+ defaults. Ruby versions from Oct. 2014 onward use sane defaults, so this is
13
+ no longer needed. (#573)
14
+
15
+ # 2.0.0
16
+
17
+ This release is largely API compatible, but makes several breaking changes.
18
+
19
+ - Drop support for Ruby 1.9
20
+ - Allow mime-types as new as 3.x (requires ruby 2.0)
21
+ - Respect Content-Type charset header provided by server. Previously,
22
+ rest-client would not override the string encoding chosen by Net::HTTP. Now
23
+ responses that specify a charset will yield a body string in that encoding.
24
+ For example, `Content-Type: text/plain; charset=EUC-JP` will return a String
25
+ encoded with `Encoding::EUC_JP`. (#361)
26
+ - Change exceptions raised on request timeout. Instead of
27
+ `RestClient::RequestTimeout` (which is still used for HTTP 408), network
28
+ timeouts will now raise either `RestClient::Exceptions::ReadTimeout` or
29
+ `RestClient::Exceptions::OpenTimeout`, both of which inherit from
30
+ `RestClient::Exceptions::Timeout`. For backwards compatibility, this still
31
+ inherits from `RestClient::RequestTimeout` so existing uses will still work.
32
+ This may change in a future major release. These new timeout classes also
33
+ make the original wrapped exception available as `#original_exception`.
34
+ - Unify request exceptions under `RestClient::RequestFailed`, which still
35
+ inherits from `ExceptionWithResponse`. Previously, HTTP 304, 401, and 404
36
+ inherited directly from `ExceptionWithResponse` rather than from
37
+ `RequestFailed`. Now _all_ HTTP status code exceptions inherit from both.
38
+ - Rename the `:timeout` request option to `:read_timeout`. When `:timeout` is
39
+ passed, now set both `:read_timeout` and `:open_timeout`.
40
+ - Change default HTTP Accept header to `*/*`
41
+ - Use a more descriptive User-Agent header by default
42
+ - Drop RC4-MD5 from default cipher list
43
+ - Only prepend http:// to URIs without a scheme
44
+ - Fix some support for using IPv6 addresses in URLs (still affected by Ruby
45
+ 2.0+ bug https://bugs.ruby-lang.org/issues/9129, with the fix expected to be
46
+ backported to 2.0 and 2.1)
47
+ - `Response` objects are now a subclass of `String` rather than a `String` that
48
+ mixes in the response functionality. Most of the methods remain unchanged,
49
+ but this makes it much easier to understand what is happening when you look
50
+ at a RestClient response object. There are a few additional changes:
51
+ - Response objects now implement `.inspect` to make this distinction clearer.
52
+ - `Response#to_i` will now behave like `String#to_i` instead of returning the
53
+ HTTP response code, which was very surprising behavior.
54
+ - `Response#body` and `#to_s` will now return a true `String` object rather
55
+ than self. Previously there was no easy way to get the true `String`
56
+ response instead of the Frankenstein response string object with
57
+ AbstractResponse mixed in.
58
+ - Response objects no longer accept an extra request args hash, but instead
59
+ access request args directly from the request object, which reduces
60
+ confusion and duplication.
61
+ - Handle multiple HTTP response headers with the same name (except for
62
+ Set-Cookie, which is special) by joining the values with a comma space,
63
+ compliant with RFC 7230
64
+ - Rewrite cookie support to be much smarter and to use cookie jars consistently
65
+ for requests, responses, and redirection in order to resolve long-standing
66
+ complaints about the previously broken behavior: (#498)
67
+ - The `:cookies` option may now be a Hash of Strings, an Array of
68
+ HTTP::Cookie objects, or a full HTTP::CookieJar.
69
+ - Add `RestClient::Request#cookie_jar` and reimplement `Request#cookies` to
70
+ be a wrapper around the cookie jar.
71
+ - Still support passing the `:cookies` option in the headers hash, but now
72
+ raise ArgumentError if that option is also passed to `Request#initialize`.
73
+ - Warn if both `:cookies` and a `Cookie` header are supplied.
74
+ - Use the `Request#cookie_jar` as the basis for `Response#cookie_jar`,
75
+ creating a copy of the jar and adding any newly received cookies.
76
+ - When following redirection, also use this same strategy so that cookies
77
+ from the original request are carried through in a standards-compliant way
78
+ by the cookie jar.
79
+ - Don't set basic auth header if explicit `Authorization` header is specified
80
+ - Add `:proxy` option to requests, which can be used for thread-safe
81
+ per-request proxy configuration, overriding `RestClient.proxy`
82
+ - Allow overriding `ENV['http_proxy']` to disable proxies by setting
83
+ `RestClient.proxy` to a falsey value. Previously there was no way in Ruby 2.x
84
+ to turn off a proxy specified in the environment without changing `ENV`.
85
+ - Add actual support for streaming request payloads. Previously rest-client
86
+ would call `.to_s` even on RestClient::Payload::Streamed objects. Instead,
87
+ treat any object that responds to `.read` as a streaming payload and pass it
88
+ through to `.body_stream=` on the Net:HTTP object. This massively reduces the
89
+ memory required for large file uploads.
90
+ - Changes to redirection behavior: (#381, #484)
91
+ - Remove `RestClient::MaxRedirectsReached` in favor of the normal
92
+ `ExceptionWithResponse` subclasses. This makes the response accessible on
93
+ the exception object as `.response`, making it possible for callers to tell
94
+ what has actually happened when the redirect limit is reached.
95
+ - When following HTTP redirection, store a list of each previous response on
96
+ the response object as `.history`. This makes it possible to access the
97
+ original response headers and body before the redirection was followed.
98
+ - Follow redirection consistently, regardless of whether the HTTP method was
99
+ passed as a symbol or string. Under the hood rest-client now normalizes the
100
+ HTTP request method to a lowercase string.
101
+ - Add `:before_execution_proc` option to `RestClient::Request`. This makes it
102
+ possible to add procs like `RestClient.add_before_execution_proc` to a single
103
+ request without global state.
104
+ - Run tests on Travis's beta OS X support.
105
+ - Make `Request#transmit` a private method, along with a few others.
106
+ - Refactor URI parsing to happen earlier, in Request initialization.
107
+ - Improve consistency and functionality of complex URL parameter handling:
108
+ - When adding URL params, handle URLs that already contain params.
109
+ - Add new convention for handling URL params containing deeply nested arrays
110
+ and hashes, unify handling of null/empty values, and use the same code for
111
+ GET and POST params. (#437)
112
+ - Add the RestClient::ParamsArray class, a simple array-like container that
113
+ can be used to pass multiple keys with same name or keys where the ordering
114
+ is significant.
115
+ - Add a few more exception classes for obscure HTTP status codes.
116
+ - Multipart: use a much more robust multipart boundary with greater entropy.
117
+ - Make `RestClient::Payload::Base#inspect` stop pretending to be a String.
118
+ - Add `Request#redacted_uri` and `Request#redacted_url` to display the URI
119
+ with any password redacted.
120
+
121
+ # 2.0.0.rc1
122
+
123
+ Changes in the release candidate that did not persist through the final 2.0.0
124
+ release:
125
+ - RestClient::Exceptions::Timeout was originally going to be a direct subclass
126
+ of RestClient::Exception in the release candidate. This exception tree was
127
+ made a subclass of RestClient::RequestTimeout prior to the final release.
128
+
129
+ # 1.8.0
130
+
131
+ - Security: implement standards compliant cookie handling by adding a
132
+ dependency on http-cookie. This breaks compatibility, but was necessary to
133
+ address a session fixation / cookie disclosure vulnerability.
134
+ (#369 / CVE-2015-1820)
135
+
136
+ Previously, any Set-Cookie headers found in an HTTP 30x response would be
137
+ sent to the redirection target, regardless of domain. Responses now expose a
138
+ cookie jar and respect standards compliant domain / path flags in Set-Cookie
139
+ headers.
140
+
141
+ # 1.7.3
142
+
143
+ - Security: redact password in URI from logs (#349 / OSVDB-117461)
144
+ - Drop monkey patch on MIME::Types (added `type_for_extension` method, use
145
+ the public interface instead.
146
+
147
+ # 1.7.2
148
+
149
+ - Ignore duplicate certificates in CA store on Windows
150
+
151
+ # 1.7.1
152
+
153
+ - Relax mime-types dependency to continue supporting mime-types 1.x series.
154
+ There seem to be a large number of popular gems that have depended on
155
+ mime-types '~> 1.16' until very recently.
156
+ - Improve urlencode performance
157
+ - Clean up a number of style points
158
+
159
+ # 1.7.0
160
+
161
+ - This release drops support for Ruby 1.8.7 and breaks compatibility in a few
162
+ other relatively minor ways
163
+ - Upgrade to mime-types ~> 2.0
164
+ - Don't CGI.unescape cookie values sent to the server (issue #89)
165
+ - Add support for reading credentials from netrc
166
+ - Lots of SSL changes and enhancements: (#268)
167
+ - Enable peer verification by default (setting `VERIFY_PEER` with OpenSSL)
168
+ - By default, use the system default certificate store for SSL verification,
169
+ even on Windows (this uses a separate Windows build that pulls in ffi)
170
+ - Add support for SSL `ca_path`
171
+ - Add support for SSL `cert_store`
172
+ - Add support for SSL `verify_callback` (with some caveats for jruby, OS X, #277)
173
+ - Add support for SSL ciphers, and choose secure ones by default
174
+ - Run tests under travis
175
+ - Several other bugfixes and test improvements
176
+ - Convert Errno::ETIMEDOUT to RestClient::RequestTimeout
177
+ - Handle more HTTP response codes from recent standards
178
+ - Save raw responses to binary mode tempfile (#110)
179
+ - Disable timeouts with :timeout => nil rather than :timeout => -1
180
+ - Drop all Net::HTTP monkey patches
181
+
182
+ # 1.6.8
183
+
184
+ - The 1.6.x series will be the last to support Ruby 1.8.7
185
+ - Pin mime-types to < 2.0 to maintain Ruby 1.8.7 support
186
+ - Add Gemfile, AUTHORS, add license to gemspec
187
+ - Point homepage at https://github.com/rest-client/rest-client
188
+ - Clean up and fix various tests and ruby warnings
189
+ - Backport `ssl_verify_callback` functionality from 1.7.0
190
+
191
+ # 1.6.7
192
+
193
+ - rebuild with 1.8.7 to avoid https://github.com/rubygems/rubygems/pull/57
194
+
195
+ # 1.6.6
196
+
197
+ - 1.6.5 was yanked
198
+
199
+ # 1.6.5
200
+
201
+ - RFC6265 requires single SP after ';' for separating parameters pairs in the 'Cookie:' header (patch provided by Hiroshi Nakamura)
202
+ - enable url parameters for all actions
203
+ - detect file parameters in arrays
204
+ - allow disabling the timeouts by passing -1 (patch provided by Sven Böhm)
205
+
206
+ # 1.6.4
207
+
208
+ - fix restclient script compatibility with 1.9.2
209
+ - fix unlinking temp file (patch provided by Evan Smith)
210
+ - monkeypatching ruby for http patch method (patch provided by Syl Turner)
211
+
212
+ # 1.6.3
213
+
214
+ - 1.6.2 was yanked
215
+
216
+ # 1.6.2
217
+
218
+ - add support for HEAD in resources (patch provided by tpresa)
219
+ - fix shell for 1.9.2
220
+ - workaround when some gem monkeypatch net/http (patch provided by Ian Warshak)
221
+ - DELETE requests should process parameters just like GET and HEAD
222
+ - adding :block_response parameter for manual processing
223
+ - limit number of redirections (patch provided by Chris Dinn)
224
+ - close and unlink the temp file created by playload (patch provided by Chris Green)
225
+ - make gemspec Rubygems 1.8 compatible (patch provided by David Backeus)
226
+ - added RestClient.reset_before_execution_procs (patch provided by Cloudify)
227
+ - added PATCH method (patch provided by Jeff Remer)
228
+ - hack for HTTP servers that use raw DEFLATE compression, see http://www.ruby-forum.com/topic/136825 (path provided by James Reeves)
229
+
230
+ # 1.6.1
231
+
232
+ - add response body in Exception#inspect
233
+ - add support for RestClient.options
234
+ - fix tests for 1.9.2 (patch provided by Niko Dittmann)
235
+ - block passing in Resource#[] (patch provided by Niko Dittmann)
236
+ - cookies set in a response should be kept in a redirect
237
+ - HEAD requests should process parameters just like GET (patch provided by Rob Eanes)
238
+ - exception message should never be nil (patch provided by Michael Klett)
239
+
240
+ # 1.6.0
241
+
242
+ - forgot to include rest-client.rb in the gem
243
+ - user, password and user-defined headers should survive a redirect
244
+ - added all missing status codes
245
+ - added parameter passing for get request using the :param key in header
246
+ - the warning about the logger when using a string was a bad idea
247
+ - multipart parameters names should not be escaped
248
+ - remove the cookie escaping introduced by migrating to CGI cookie parsing in 1.5.1
249
+ - add a streamed payload type (patch provided by Caleb Land)
250
+ - Exception#http_body works even when no response
251
+
252
+ # 1.5.1
253
+
254
+ - only converts headers keys which are Symbols
255
+ - use CGI for cookie parsing instead of custom code
256
+ - unescape user and password before using them (patch provided by Lars Gierth)
257
+ - expand ~ in ~/.restclientrc (patch provided by Mike Fletcher)
258
+ - ssl verification raise an exception when the ca certificate is incorrect (patch provided by Braintree)
259
+
260
+ # 1.5.0
261
+
262
+ - the response is now a String with the Response module a.k.a. the change in 1.4.0 was a mistake (Response.body is returning self for compatability)
263
+ - added AbstractResponse.to_i to improve semantic
264
+ - multipart Payloads ignores the name attribute if it's not set (patch provided by Tekin Suleyman)
265
+ - correctly takes into account user headers whose keys are strings (path provided by Cyril Rohr)
266
+ - use binary mode for payload temp file
267
+ - concatenate cookies with ';'
268
+ - fixed deeper parameter handling
269
+ - do not quote the boundary in the Content-Type header (patch provided by W. Andrew Loe III)
270
+
271
+ # 1.4.2
272
+
273
+ - fixed RestClient.add_before_execution_proc (patch provided by Nicholas Wieland)
274
+ - fixed error when an exception is raised without a response (patch provided by Caleb Land)
275
+
276
+ # 1.4.1
277
+
278
+ - fixed parameters managment when using hash
279
+
280
+ # 1.4.0
281
+
282
+ - Response is no more a String, and the mixin is replaced by an abstract_response, existing calls are redirected to response body with a warning.
283
+ - enable repeated parameters RestClient.post 'http://example.com/resource', :param1 => ['one', 'two', 'three'], => :param2 => 'foo' (patch provided by Rodrigo Panachi)
284
+ - fixed the redirect code concerning relative path and query string combination (patch provided by Kevin Read)
285
+ - redirection code moved to Response so redirection can be customized using the block syntax
286
+ - only get and head redirections are now followed by default, as stated in the specification
287
+ - added RestClient.add_before_execution_proc to hack the http request, like for oauth
288
+
289
+ The response change may be breaking in rare cases.
290
+
291
+ # 1.3.1
292
+
293
+ - added compatibility to enable responses in exception to act like Net::HTTPResponse
294
+
295
+ # 1.3.0
296
+
297
+ - a block can be used to process a request's result, this enable to handle custom error codes or paththrought (design by Cyril Rohr)
298
+ - cleaner log API, add a warning for some cases but should be compatible
299
+ - accept multiple "Set-Cookie" headers, see http://www.ietf.org/rfc/rfc2109.txt (patch provided by Cyril Rohr)
300
+ - remove "Content-Length" and "Content-Type" headers when following a redirection (patch provided by haarts)
301
+ - all http error codes have now a corresponding exception class and all of them contain the Reponse -> this means that the raised exception can be different
302
+ - changed "Content-Disposition: multipart/form-data" to "Content-Disposition: form-data" per RFC 2388 (patch provided by Kyle Crawford)
303
+
304
+ The only breaking change should be the exception classes, but as the new classes inherits from the existing ones, the breaking cases should be rare.
305
+
306
+ # 1.2.0
307
+
308
+ - formatting changed from tabs to spaces
309
+ - logged requests now include generated headers
310
+ - accept and content-type headers can now be specified using extentions: RestClient.post "http://example.com/resource", { 'x' => 1 }.to_json, :content_type => :json, :accept => :json
311
+ - should be 1.1.1 but renamed to 1.2.0 because 1.1.X versions has already been packaged on Debian
312
+
313
+ # 1.1.0
314
+
315
+ - new maintainer: Archiloque, the working repo is now at http://github.com/archiloque/rest-client
316
+ - a mailing list has been created at rest.client@librelist.com and an freenode irc channel #rest-client
317
+ - François Beausoleil' multipart code from http://github.com/francois/rest-client has been merged
318
+ - ability to use hash in hash as payload
319
+ - the mime-type code now rely on the mime-types gem http://mime-types.rubyforge.org/ instead of an internal partial list
320
+ - 204 response returns a Response instead of nil (patch provided by Elliott Draper)
321
+
322
+ All changes exept the last one should be fully compatible with the previous version.
323
+
324
+ NOTE: due to a dependency problem and to the last change, heroku users should update their heroku gem to >= 1.5.3 to be able to use this version.