httparty 0.14.0 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of httparty might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.editorconfig +18 -0
- data/.github/workflows/ci.yml +23 -0
- data/.gitignore +2 -0
- data/.rubocop_todo.yml +1 -1
- data/{History → Changelog.md} +216 -63
- data/Gemfile +6 -1
- data/README.md +8 -8
- data/bin/httparty +3 -1
- data/docs/README.md +108 -37
- data/examples/README.md +34 -12
- data/examples/aaws.rb +7 -3
- data/examples/body_stream.rb +14 -0
- data/examples/crack.rb +1 -1
- data/examples/custom_parsers.rb +5 -1
- data/examples/delicious.rb +4 -4
- data/examples/headers_and_user_agents.rb +7 -3
- data/examples/idn.rb +10 -0
- data/examples/logging.rb +4 -4
- data/examples/microsoft_graph.rb +52 -0
- data/examples/multipart.rb +22 -0
- data/examples/peer_cert.rb +9 -0
- data/examples/stackexchange.rb +1 -1
- data/examples/stream_download.rb +26 -0
- data/examples/tripit_sign_in.rb +1 -1
- data/examples/twitter.rb +2 -2
- data/examples/whoismyrep.rb +1 -1
- data/httparty.gemspec +7 -4
- data/lib/httparty/connection_adapter.rb +73 -16
- data/lib/httparty/cookie_hash.rb +10 -8
- data/lib/httparty/decompressor.rb +92 -0
- data/lib/httparty/exceptions.rb +4 -1
- data/lib/httparty/hash_conversions.rb +30 -12
- data/lib/httparty/headers_processor.rb +32 -0
- data/lib/httparty/logger/apache_formatter.rb +31 -6
- data/lib/httparty/logger/curl_formatter.rb +9 -7
- data/lib/httparty/logger/logger.rb +5 -1
- data/lib/httparty/logger/logstash_formatter.rb +61 -0
- data/lib/httparty/module_inheritable_attributes.rb +6 -4
- data/lib/httparty/net_digest_auth.rb +19 -19
- data/lib/httparty/parser.rb +25 -14
- data/lib/httparty/request/body.rb +98 -0
- data/lib/httparty/request/multipart_boundary.rb +13 -0
- data/lib/httparty/request.rb +137 -110
- data/lib/httparty/response/headers.rb +23 -19
- data/lib/httparty/response.rb +81 -22
- data/lib/httparty/response_fragment.rb +21 -0
- data/lib/httparty/text_encoder.rb +72 -0
- data/lib/httparty/utils.rb +13 -0
- data/lib/httparty/version.rb +3 -1
- data/lib/httparty.rb +79 -30
- data/website/css/common.css +1 -1
- metadata +37 -103
- data/.travis.yml +0 -9
- data/features/basic_authentication.feature +0 -20
- data/features/command_line.feature +0 -95
- data/features/deals_with_http_error_codes.feature +0 -26
- data/features/digest_authentication.feature +0 -30
- data/features/handles_compressed_responses.feature +0 -27
- data/features/handles_multiple_formats.feature +0 -57
- data/features/steps/env.rb +0 -27
- data/features/steps/httparty_response_steps.rb +0 -56
- data/features/steps/httparty_steps.rb +0 -43
- data/features/steps/mongrel_helper.rb +0 -127
- data/features/steps/remote_service_steps.rb +0 -92
- data/features/supports_read_timeout_option.feature +0 -13
- data/features/supports_redirection.feature +0 -22
- data/features/supports_timeout_option.feature +0 -13
- data/spec/fixtures/delicious.xml +0 -23
- data/spec/fixtures/empty.xml +0 -0
- data/spec/fixtures/google.html +0 -3
- data/spec/fixtures/ssl/generate.sh +0 -29
- data/spec/fixtures/ssl/generated/1fe462c2.0 +0 -16
- data/spec/fixtures/ssl/generated/bogushost.crt +0 -13
- data/spec/fixtures/ssl/generated/ca.crt +0 -16
- data/spec/fixtures/ssl/generated/ca.key +0 -15
- data/spec/fixtures/ssl/generated/selfsigned.crt +0 -14
- data/spec/fixtures/ssl/generated/server.crt +0 -13
- data/spec/fixtures/ssl/generated/server.key +0 -15
- data/spec/fixtures/ssl/openssl-exts.cnf +0 -9
- data/spec/fixtures/twitter.csv +0 -2
- data/spec/fixtures/twitter.json +0 -1
- data/spec/fixtures/twitter.xml +0 -403
- data/spec/fixtures/undefined_method_add_node_for_nil.xml +0 -2
- data/spec/httparty/connection_adapter_spec.rb +0 -495
- data/spec/httparty/cookie_hash_spec.rb +0 -100
- data/spec/httparty/exception_spec.rb +0 -45
- data/spec/httparty/hash_conversions_spec.rb +0 -49
- data/spec/httparty/logger/apache_formatter_spec.rb +0 -41
- data/spec/httparty/logger/curl_formatter_spec.rb +0 -119
- data/spec/httparty/logger/logger_spec.rb +0 -38
- data/spec/httparty/net_digest_auth_spec.rb +0 -240
- data/spec/httparty/parser_spec.rb +0 -173
- data/spec/httparty/request_spec.rb +0 -1183
- data/spec/httparty/response_spec.rb +0 -291
- data/spec/httparty/ssl_spec.rb +0 -74
- data/spec/httparty_spec.rb +0 -872
- data/spec/spec_helper.rb +0 -59
- data/spec/support/ssl_test_helper.rb +0 -47
- data/spec/support/ssl_test_server.rb +0 -80
- data/spec/support/stub_response.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bde34a85d8b010341759c1b2b42dfe58cad693c39f047b9803ac90afbc13290b
|
4
|
+
data.tar.gz: b5248420c90ea545dfa9e6e234d6c597b4c7306dfc8d58ff94dca82e405e0ed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13316910a85a75d1204c64be41e995475b26abf9aad1165c06349c296d0b3f0f6ae644b00d8bcf14adc3d9a11659bffd060a5101dc88718af74d0324adde9e30
|
7
|
+
data.tar.gz: 668fac0ca6a513e64dead9b633ecb12c4ff926cb017e4e7e244249cfb361f93e1aa515ef3fb6b80e6245264e7da38d0599abec9931c5b33b88d7235b966b0aa1
|
data/.editorconfig
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
; This file is for unifying the coding style for different editors and IDEs.
|
2
|
+
; More information at http://EditorConfig.org
|
3
|
+
|
4
|
+
root = true
|
5
|
+
[*]
|
6
|
+
end_of_line = lf
|
7
|
+
trim_trailing_whitespace = true
|
8
|
+
|
9
|
+
[**.rb]
|
10
|
+
indent_size = 2
|
11
|
+
indent_style = spaces
|
12
|
+
insert_final_newline = true
|
13
|
+
|
14
|
+
[**.xml]
|
15
|
+
trim_trailing_whitespace = false
|
16
|
+
|
17
|
+
[**.html]
|
18
|
+
trim_trailing_whitespace = false
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
build:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
strategy:
|
7
|
+
matrix:
|
8
|
+
ruby:
|
9
|
+
- 2.3
|
10
|
+
- 2.4
|
11
|
+
- 2.5
|
12
|
+
- 2.6
|
13
|
+
- 2.7
|
14
|
+
steps:
|
15
|
+
- name: Check out repository code
|
16
|
+
uses: actions/checkout@v2
|
17
|
+
- name: Set up Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: ${{ matrix.ruby }}
|
21
|
+
bundler-cache: true # Run "bundle install", and cache the result automatically.
|
22
|
+
- name: Run Rake
|
23
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rubocop_todo.yml
CHANGED
data/{History → Changelog.md}
RENAMED
@@ -1,15 +1,168 @@
|
|
1
|
-
|
1
|
+
## 0.20.0
|
2
|
+
|
3
|
+
Breaking changes
|
4
|
+
|
5
|
+
* Require Ruby >= 2.3.0
|
6
|
+
|
7
|
+
Fixes
|
8
|
+
|
9
|
+
* [`Marshal.dump` fails on response objects when request option `:logger` is set or `:parser` is a proc](https://github.com/jnunemaker/httparty/pull/714)
|
10
|
+
* [Switch `:pem` option to to `OpenSSL::PKey.read` to support other algorithms](https://github.com/jnunemaker/httparty/pull/720)
|
11
|
+
|
12
|
+
## 0.19.1
|
13
|
+
|
14
|
+
* [Remove use of unary + method for creating non-frozen string to increase compatibility with older versions of ruby](https://github.com/jnunemaker/httparty/commit/4416141d37fd71bdba4f37589ec265f55aa446ce)
|
15
|
+
|
16
|
+
## 0.19.0
|
17
|
+
|
18
|
+
* [Multipart/Form-Data: rewind files after read](https://github.com/jnunemaker/httparty/pull/709)
|
19
|
+
* [add frozen_string_literal pragma to all files](https://github.com/jnunemaker/httparty/pull/711)
|
20
|
+
* [Better handling of Accept-Encoding / Content-Encoding decompression (fixes #562)](https://github.com/jnunemaker/httparty/pull/729)
|
21
|
+
|
22
|
+
## 0.18.1
|
23
|
+
|
24
|
+
* [Rename cop Lint/HandleExceptions to Lint/SuppressedException](https://github.com/jnunemaker/httparty/pull/699).
|
25
|
+
* [Encode keys in query params](https://github.com/jnunemaker/httparty/pull/698).
|
26
|
+
* [Fixed SSL doc example](https://github.com/jnunemaker/httparty/pull/692).
|
27
|
+
* [Add a build status badge](https://github.com/jnunemaker/httparty/pull/701).
|
28
|
+
|
29
|
+
|
30
|
+
## 0.18.0
|
31
|
+
|
32
|
+
* [Support gzip/deflate transfer encoding when explicit headers are set](https://github.com/jnunemaker/httparty/pull/678).
|
33
|
+
* [Support edge case cookie format with a blank attribute](https://github.com/jnunemaker/httparty/pull/685).
|
34
|
+
|
35
|
+
## 0.17.3
|
36
|
+
|
37
|
+
0.17.2 is broken https://github.com/jnunemaker/httparty/issues/681
|
38
|
+
|
39
|
+
## 0.17.2
|
40
|
+
|
41
|
+
* [Add Response#nil? deprecetion warning](https://github.com/jnunemaker/httparty/pull/680)
|
42
|
+
|
43
|
+
## 0.17.1
|
44
|
+
|
45
|
+
* [Pass options to dynamic block headers](https://github.com/jnunemaker/httparty/pull/661)
|
46
|
+
* [Normalize urls with URI adapter to allow International Domain Names support](https://github.com/jnunemaker/httparty/pull/668)
|
47
|
+
* [Add max_retries support](https://github.com/jnunemaker/httparty/pull/660)
|
48
|
+
* [Minize gem size by removing test files](https://github.com/jnunemaker/httparty/pull/658)
|
49
|
+
|
50
|
+
## 0.17.0
|
51
|
+
|
52
|
+
* [Fix encoding of streamed chunk](https://github.com/jnunemaker/httparty/pull/644)
|
53
|
+
* [Avoid modifying frozen strings](https://github.com/jnunemaker/httparty/pull/649)
|
54
|
+
* [Expose .connection on fragment block param](https://github.com/jnunemaker/httparty/pull/648)
|
55
|
+
* [Add support for `Net::HTTP#write_timeout` method (Ruby 2.6.0)](https://github.com/jnunemaker/httparty/pull/647)
|
56
|
+
|
57
|
+
## 0.16.4
|
58
|
+
* [Add support for Ruby 2.6](https://github.com/jnunemaker/httparty/pull/636)
|
59
|
+
* [Fix a few multipart issues](https://github.com/jnunemaker/httparty/pull/626)
|
60
|
+
* [Improve a memory usage for https requests](https://github.com/jnunemaker/httparty/pull/625)
|
61
|
+
* [Add response code to streamed body](https://github.com/jnunemaker/httparty/pull/588)
|
62
|
+
|
63
|
+
## 0.16.3
|
64
|
+
* [Add Logstash-compatible formatter](https://github.com/jnunemaker/httparty/pull/612)
|
65
|
+
* [Add support for headers specified with symbols](https://github.com/jnunemaker/httparty/pull/622)
|
66
|
+
* [Fix response object marshalling](https://github.com/jnunemaker/httparty/pull/618)
|
67
|
+
* [Add ability to send multipart, without passing file](https://github.com/jnunemaker/httparty/pull/615)
|
68
|
+
* [Fix detection of content_type for multipart payload](https://github.com/jnunemaker/httparty/pull/616)
|
69
|
+
* [Process dynamic headers before making actual request](https://github.com/jnunemaker/httparty/pull/606)
|
70
|
+
* [Fix multipart uploads with ActionDispatch::Http::UploadedFile TempFile by using original_filename](https://github.com/jnunemaker/httparty/pull/598)
|
71
|
+
* [Added support for lock and unlock http requests](https://github.com/jnunemaker/httparty/pull/596)
|
72
|
+
|
73
|
+
## 0.16.2
|
74
|
+
|
75
|
+
* [Support ActionDispatch::Http::UploadedFile again](https://github.com/jnunemaker/httparty/pull/585)
|
76
|
+
|
77
|
+
## 0.16.1
|
78
|
+
|
79
|
+
* [Parse content with application/hal+json content type as JSON](https://github.com/jnunemaker/httparty/pull/573)
|
80
|
+
* [Convert objects to string when concatenating in multipart stuff](https://github.com/jnunemaker/httparty/pull/575)
|
81
|
+
* [Fix multipart to set its header even when other headers are provided](https://github.com/jnunemaker/httparty/pull/576)
|
82
|
+
|
83
|
+
## 0.16.0
|
84
|
+
|
85
|
+
* [Add multipart support](https://github.com/jnunemaker/httparty/pull/569)
|
86
|
+
|
87
|
+
## 0.15.7
|
88
|
+
|
89
|
+
Fixed
|
90
|
+
|
91
|
+
* [Add Response#pretty_print | Restore documented behavior](https://github.com/jnunemaker/httparty/pull/570)
|
92
|
+
* [Add ability to parse response from JSONAPI ](https://github.com/jnunemaker/httparty/pull/553)
|
93
|
+
|
94
|
+
## 0.15.6
|
95
|
+
|
96
|
+
Fixed
|
97
|
+
|
98
|
+
* [Encoding and content type stuff](https://github.com/jnunemaker/httparty/pull/543)
|
99
|
+
|
100
|
+
## 0.15.5
|
101
|
+
|
102
|
+
Fixed
|
103
|
+
|
104
|
+
* [Use non-destructive gsub](https://github.com/jnunemaker/httparty/pull/540)
|
105
|
+
|
106
|
+
## 0.15.4
|
107
|
+
|
108
|
+
Fixed
|
109
|
+
|
110
|
+
* Prevent gsub errors with different encodings.
|
111
|
+
* Prevent passing nil to encode_body.
|
112
|
+
|
113
|
+
## 0.15.3
|
114
|
+
|
115
|
+
Fixed
|
116
|
+
|
117
|
+
* [Fix processing nil body for HEAD requests](https://github.com/jnunemaker/httparty/pull/530).
|
118
|
+
* Add missing require to headers.rb (33439a8).
|
119
|
+
|
120
|
+
## 0.15.2
|
121
|
+
|
122
|
+
Fixed
|
123
|
+
|
124
|
+
* Remove symlink from specs. It was reportedly still getting bundled with gem.
|
125
|
+
|
126
|
+
## 0.15.1
|
127
|
+
|
128
|
+
Fixed
|
129
|
+
|
130
|
+
* Stop including test files in gem. Fixes installation issues on windows due to symlink in spec dir.
|
131
|
+
|
132
|
+
## 0.15.0
|
133
|
+
|
134
|
+
Breaking Changes
|
135
|
+
|
136
|
+
* require Ruby >= 2.0.0
|
137
|
+
|
138
|
+
Fixed
|
139
|
+
|
140
|
+
* [fix numerous bugs](https://github.com/jnunemaker/httparty/pull/513)
|
141
|
+
* [handle utf-8 bom for json parsing](https://github.com/jnunemaker/httparty/pull/520)
|
142
|
+
* [do not overwrite default headers unless specified](https://github.com/jnunemaker/httparty/pull/518)
|
143
|
+
|
144
|
+
## 0.14.0
|
145
|
+
|
146
|
+
Breaking Changes
|
147
|
+
|
148
|
+
* None
|
149
|
+
|
150
|
+
Added
|
151
|
+
|
2
152
|
* [added status predicate methods to Response#respond_to?](https://github.com/jnunemaker/httparty/pull/482)
|
153
|
+
* [support for MKCOL method](https://github.com/jnunemaker/httparty/pull/465)
|
154
|
+
* one fewer dependency: [remove json gem from gemspec](https://github.com/jnunemaker/httparty/pull/464)
|
155
|
+
* [optional raising exception on certain status codes](https://github.com/jnunemaker/httparty/pull/455)
|
156
|
+
|
157
|
+
Fixed
|
158
|
+
|
3
159
|
* [allow empty array to be used as param](https://github.com/jnunemaker/httparty/pull/477)
|
4
|
-
* [add support for MKCOL method](https://github.com/jnunemaker/httparty/pull/465)
|
5
|
-
* [remove json gem from gemspec](https://github.com/jnunemaker/httparty/pull/464)
|
6
160
|
* [stop mutating cookie hash](https://github.com/jnunemaker/httparty/pull/460)
|
7
|
-
* [optional raising exception on certain status codes](https://github.com/jnunemaker/httparty/pull/455)
|
8
161
|
|
9
|
-
|
162
|
+
## 0.13.7 aka "party not as hard"
|
10
163
|
* remove post install emoji as it caused installation issues for some people
|
11
164
|
|
12
|
-
|
165
|
+
## 0.13.6
|
13
166
|
* avoid calling String#strip on invalid Strings
|
14
167
|
* preserve request method on 307 and 308 redirects
|
15
168
|
* output version with --version for command line bin
|
@@ -17,25 +170,25 @@
|
|
17
170
|
* add support for RFC2617 MD5-sess algorithm type
|
18
171
|
* add party popper emoji to post install message
|
19
172
|
|
20
|
-
|
173
|
+
## 0.13.5
|
21
174
|
* allow setting a custom URI adapter
|
22
175
|
|
23
|
-
|
176
|
+
## 0.13.4
|
24
177
|
* correct redirect url for redirect paths without leading slash
|
25
178
|
* remove core_extensions.rb as backwards compat for ruby 1.8 not needed
|
26
179
|
* replace URI.encode with ERB::Util.url_encode
|
27
180
|
* allow the response to be tapped
|
28
181
|
|
29
|
-
|
182
|
+
## 0.13.3
|
30
183
|
* minor improvement
|
31
184
|
* added option to allow for streaming large files without loading them into memory (672cdae)
|
32
185
|
|
33
|
-
|
186
|
+
## 0.13.2
|
34
187
|
* minor improvement
|
35
188
|
* [Set correct path on redirect to filename](https://github.com/jnunemaker/httparty/pull/337)
|
36
189
|
* ensure logger works with curl format
|
37
190
|
|
38
|
-
|
191
|
+
## 0.13.1 2014-04-08
|
39
192
|
* new
|
40
193
|
* [Added ability to specify a body_stream in HttpRequest](https://github.com/jnunemaker/httparty/pull/275)
|
41
194
|
* [Added read_timeout and open_timeout options](https://github.com/jnunemaker/httparty/pull/278)
|
@@ -44,7 +197,7 @@
|
|
44
197
|
* minor improvement
|
45
198
|
* [Add stackexchange API example](https://github.com/jnunemaker/httparty/pull/280)
|
46
199
|
|
47
|
-
|
200
|
+
## 0.13.0 2014-02-14
|
48
201
|
* new
|
49
202
|
* [Add CSV support](https://github.com/jnunemaker/httparty/pull/269)
|
50
203
|
* [Allows PKCS12 client certificates](https://github.com/jnunemaker/httparty/pull/246)
|
@@ -59,7 +212,7 @@
|
|
59
212
|
* minor improvement
|
60
213
|
* [Add HTTParty::Error base class](https://github.com/jnunemaker/httparty/pull/260)
|
61
214
|
|
62
|
-
|
215
|
+
## 0.12.0 2013-10-10
|
63
216
|
* new
|
64
217
|
* [Added initial logging support](https://github.com/jnunemaker/httparty/pull/243)
|
65
218
|
* [Add support for local host and port binding](https://github.com/jnunemaker/httparty/pull/238)
|
@@ -79,7 +232,7 @@
|
|
79
232
|
* [Improve documentation of ssl_ca_file, ssl_ca_path](https://github.com/jnunemaker/httparty/pull/223)
|
80
233
|
* [Fix example URLs](https://github.com/jnunemaker/httparty/pull/232)
|
81
234
|
|
82
|
-
|
235
|
+
## 0.11.0 2013-04-10
|
83
236
|
* new
|
84
237
|
* [Add COPY http request handling](https://github.com/jnunemaker/httparty/pull/190)
|
85
238
|
* [Ruby 2.0 tests](https://github.com/jnunemaker/httparty/pull/194)
|
@@ -91,20 +244,20 @@
|
|
91
244
|
* change
|
92
245
|
* [Client-side-only cookie attributes are removed: case-insensitive](https://github.com/jnunemaker/httparty/pull/188)
|
93
246
|
|
94
|
-
|
247
|
+
## 0.10.2 2013-01-26
|
95
248
|
* bug fix
|
96
249
|
* [hash_conversions misnamed variable](https://github.com/jnunemaker/httparty/pull/187)
|
97
250
|
|
98
|
-
|
251
|
+
## 0.10.1 2013-01-26
|
99
252
|
* new
|
100
253
|
* [Added support for MOVE requests](https://github.com/jnunemaker/httparty/pull/183)
|
101
254
|
* [Bump multi xml version](https://github.com/jnunemaker/httparty/pull/181)
|
102
255
|
|
103
|
-
|
256
|
+
## 0.10.0 2013-01-10
|
104
257
|
* changes
|
105
258
|
* removed yaml support because of security risk (see rails yaml issues)
|
106
259
|
|
107
|
-
|
260
|
+
## 0.9.0 2012-09-07
|
108
261
|
* new
|
109
262
|
* [support for connection adapters](https://github.com/jnunemaker/httparty/pull/157)
|
110
263
|
* [allow ssl_version on ruby 1.9](https://github.com/jnunemaker/httparty/pull/159)
|
@@ -113,14 +266,14 @@
|
|
113
266
|
* [deep clone default options](https://github.com/jnunemaker/httparty/commit/f74227d30f9389b4b23a888c9af49fb9b8248e1f)
|
114
267
|
* a few net digest auth fixes
|
115
268
|
|
116
|
-
|
269
|
+
## 0.8.3 2012-04-21
|
117
270
|
* new
|
118
271
|
* [lazy parsing of responses](https://github.com/jnunemaker/httparty/commit/9fd5259c8dab00e426082b66af44ede2c9068f45)
|
119
272
|
* [add support for PATCH requests](https://github.com/jnunemaker/httparty/commit/7ab6641e37a9e31517e46f6124f38c615395d38a)
|
120
273
|
* bug fixes
|
121
274
|
* [subclasses no longer override superclass options](https://github.com/jnunemaker/httparty/commit/682af8fbf672e7b3009e650da776c85cdfe78d39)
|
122
275
|
|
123
|
-
|
276
|
+
## 0.8.2 2012-04-12
|
124
277
|
* new
|
125
278
|
* add -r to make CLI return failure code if status >= 400
|
126
279
|
* allow blank username from CLI
|
@@ -133,47 +286,47 @@
|
|
133
286
|
* require rexml/document if xml format from CLI
|
134
287
|
* support for fragmented responses
|
135
288
|
|
136
|
-
|
289
|
+
## 0.8.1 2011-10-05
|
137
290
|
* bug fixes
|
138
291
|
* content-encoding header should be removed when automatically inflating the body
|
139
292
|
|
140
|
-
|
293
|
+
## 0.8.0 2011-09-13
|
141
294
|
* new
|
142
295
|
* switch to multi json/xml for parsing by default
|
143
296
|
* bug fixes
|
144
297
|
* fix redirects to relative uri's
|
145
298
|
|
146
|
-
|
299
|
+
## 0.7.8 2011-06-06
|
147
300
|
* bug fix
|
148
301
|
* Make response honor respond to
|
149
302
|
* net http timeout can also be a float
|
150
303
|
|
151
|
-
|
304
|
+
## 0.7.7 2011-04-16
|
152
305
|
* bug fix
|
153
306
|
* Fix NoMethodError when using the NON_RAILS_QUERY_STRING_NORMALIZER with a hash whose key is a symbol and value is nil
|
154
307
|
|
155
|
-
|
308
|
+
## 0.7.5 2011-04-16
|
156
309
|
* bug fix
|
157
310
|
* caused issue with latest rubygems
|
158
311
|
|
159
|
-
|
312
|
+
## 0.7.4 2011-02-13
|
160
313
|
* bug fixes
|
161
314
|
* Set VERIFY_NONE when using https. Ruby 1.9.2 no longer sets this for us. gh-67
|
162
315
|
|
163
|
-
|
316
|
+
## 0.7.3 2011-01-20
|
164
317
|
* bug fixes
|
165
318
|
* Fix digest auth for unspecified quality of protection (bjoernalbers, mtrudel, dwo)
|
166
319
|
|
167
|
-
|
320
|
+
## 0.7.2 2011-01-20
|
168
321
|
* bug fixes
|
169
322
|
* Fix gem dependencies
|
170
323
|
|
171
|
-
|
324
|
+
## 0.7.1 2011-01-19
|
172
325
|
* bug fixes
|
173
326
|
* Fix uninitialized constant HTTParty::Response::Net in 1.9.2 (cap10morgan)
|
174
327
|
* Other fixes for 1.9.2, full suite still fails (cap10morgan)
|
175
328
|
|
176
|
-
|
329
|
+
## 0.7.0 2011-01-18
|
177
330
|
* minor enhancements
|
178
331
|
* Added query methods for HTTP status codes, i.e. response.success?
|
179
332
|
response.created? (thanks citizenparker)
|
@@ -189,7 +342,7 @@
|
|
189
342
|
* Fixed superclass mismatch exception while running tests
|
190
343
|
(thanks dlitz http://github.com/dlitz/httparty/commit/48224f0615b32133afcff4718ad426df7a4b401b)
|
191
344
|
|
192
|
-
|
345
|
+
## 0.6.1 2010-07-07
|
193
346
|
* minor enhancements
|
194
347
|
* updated to crack 0.1.8
|
195
348
|
* bug fixes
|
@@ -197,7 +350,7 @@
|
|
197
350
|
default_cookies (l4rk).
|
198
351
|
* subclasses play nicely with grand parents. gh-49
|
199
352
|
|
200
|
-
|
353
|
+
## 0.6.0 2010-06-13
|
201
354
|
* major enhancements
|
202
355
|
* Digest Auth (bartiaco, sbecker, gilles, and aaronrussell)
|
203
356
|
* Maintain HTTP method across redirects (bartiaco and sbecker)
|
@@ -215,11 +368,11 @@
|
|
215
368
|
* Closed #40 "Gzip response" wherein gziped and deflated responses are
|
216
369
|
automatically inflated. (carsonmcdonald)
|
217
370
|
|
218
|
-
|
371
|
+
## 0.5.2 2010-01-31
|
219
372
|
* minor enhancements
|
220
373
|
* Update crack requirement to version 0.1.6
|
221
374
|
|
222
|
-
|
375
|
+
## 0.5.1 2010-01-30
|
223
376
|
* bug fixes
|
224
377
|
* Handle 304 response correctly by returning the HTTParty::Response object instead of redirecting (seth and hellvinz)
|
225
378
|
* Only redirect 300 responses if the header contains a Location
|
@@ -236,7 +389,7 @@
|
|
236
389
|
* HTTParty::VERSION now available
|
237
390
|
* Update crack requirement to version 0.1.5
|
238
391
|
|
239
|
-
|
392
|
+
## 0.5.0 2009-12-07
|
240
393
|
* bug fixes
|
241
394
|
* inheritable attributes no longer mutable by subclasses (yyyc514)
|
242
395
|
* namespace BasicObject within HTTParty to avoid class name collisions (eric)
|
@@ -254,7 +407,7 @@
|
|
254
407
|
* Support HEAD and OPTION verbs (grempe)
|
255
408
|
* Verify SSL certificates when providing a PEM file (collectiveidea/danielmorrison)
|
256
409
|
|
257
|
-
|
410
|
+
## 0.4.5 2009-09-12
|
258
411
|
* bug fixes
|
259
412
|
* Fixed class-level headers overwritten by cookie management code. Closes #19
|
260
413
|
* Fixed "superclass mismatch for class BlankSlate" error. Closes #20
|
@@ -265,55 +418,55 @@
|
|
265
418
|
HTTParty.get "http://github.com", timeout: 1
|
266
419
|
* Building gem with Jeweler
|
267
420
|
|
268
|
-
|
421
|
+
## 0.4.4 2009-07-19
|
269
422
|
* 2 minor update
|
270
423
|
* :query no longer sets form data. Use body and set content type to application/x-www-form-urlencoded if you need it. :query was wrong for that.
|
271
424
|
* Fixed a bug in the cookies class method that caused cookies to be forgotten after the first request.
|
272
425
|
* Also, some general cleanup of tests and such.
|
273
426
|
|
274
|
-
|
427
|
+
## 0.4.3 2009-04-23
|
275
428
|
* 1 minor update
|
276
429
|
* added message to the response object
|
277
430
|
|
278
|
-
|
431
|
+
## 0.4.2 2009-03-30
|
279
432
|
* 2 minor changes
|
280
433
|
* response code now returns an integer instead of a string (jqr)
|
281
434
|
* rubyforge project setup for crack so i'm now depending on that instead of jnunemaker-crack
|
282
435
|
|
283
|
-
|
436
|
+
## 0.4.1 2009-03-29
|
284
437
|
* 1 minor fix
|
285
438
|
* gem 'jnunemaker-crack' instead of gem 'crack'
|
286
439
|
|
287
|
-
|
440
|
+
## 0.4.0 2009-03-29
|
288
441
|
* 1 minor change
|
289
442
|
* Switched xml and json parsing to crack (same code as before just moved to gem for easier reuse in other projects)
|
290
443
|
|
291
|
-
|
444
|
+
## 0.3.1 2009-02-10
|
292
445
|
* 1 minor fix, 1 minor enhancement
|
293
446
|
* Fixed unescaping umlauts (siebertm)
|
294
447
|
* Added yaml response parsing (Miha Filej)
|
295
448
|
|
296
|
-
|
449
|
+
## 0.3.0 2009-01-31
|
297
450
|
* 1 major enhancement, 1 bug fix
|
298
451
|
* JSON gem no longer a requirement. It was conflicting with rails json stuff so I just stole ActiveSupport's json decoding and bundled it with HTTParty.
|
299
452
|
* Fixed bug where query strings were being duplicated on redirects
|
300
453
|
* Added a bunch of specs and moved some code around.
|
301
454
|
|
302
|
-
|
455
|
+
## 0.2.10 2009-01-29
|
303
456
|
* 1 minor enhancement
|
304
457
|
* Made encoding on query parameters treat everything except URI::PATTERN::UNRESERVED as UNSAFE to force encoding of '+' character (Julian Russell)
|
305
458
|
|
306
|
-
|
459
|
+
## 0.2.9 2009-01-29
|
307
460
|
* 3 minor enhancements
|
308
461
|
* Added a 'headers' accessor to the response with a hash of any HTTP headers. (Don Peterson)
|
309
462
|
* Add support for a ":cookies" option to be used at the class level, or as an option on any individual call. It should be passed a hash, which will be converted to the proper format and added to the request headers when the call is made. (Don Peterson)
|
310
463
|
* Refactored several specs and added a full suite of cucumber features (Don Peterson)
|
311
464
|
|
312
|
-
|
465
|
+
## 0.2.8 2009-01-28
|
313
466
|
* 1 major fix
|
314
467
|
* fixed major bug with response where it wouldn't iterate or really work at all with parsed responses
|
315
468
|
|
316
|
-
|
469
|
+
## 0.2.7 2009-01-28
|
317
470
|
* 2 minor fixes, 2 minor enhancements, 2 major enhancements
|
318
471
|
* fixed undefined method add_node for nil class error that occasionally happened (juliocesar)
|
319
472
|
* Handle nil or unexpected values better when typecasting. (Brian Landau)
|
@@ -322,77 +475,77 @@
|
|
322
475
|
* Added first class response object that includes original body and status code (Alex Vollmer)
|
323
476
|
* Now parsing all response types as some non-200 responses provide important information, this means no more exception raising (Alex Vollmer)
|
324
477
|
|
325
|
-
|
478
|
+
## 0.2.6 2009-01-05
|
326
479
|
* 1 minor bug fix
|
327
480
|
* added explicit require of time as Time#parse failed outside of rails (willcodeforfoo)
|
328
481
|
|
329
|
-
|
482
|
+
## 0.2.5 2009-01-05
|
330
483
|
* 1 major enhancement
|
331
484
|
* Add command line interface to HTTParty (Alex Vollmer)
|
332
485
|
|
333
|
-
|
486
|
+
## 0.2.4 2008-12-23
|
334
487
|
* 1 bug fix
|
335
488
|
* Fixed that mimetype detection was failing if no mimetype was returned from service (skippy)
|
336
|
-
|
489
|
+
## 0.2.3 2008-12-23
|
337
490
|
* 1 bug fix
|
338
491
|
* Fixed typecasting class variable naming issue
|
339
492
|
|
340
|
-
|
493
|
+
## 0.2.2 2008-12-08
|
341
494
|
* 1 bug fix
|
342
495
|
* Added the missing core extension hash method to_xml_attributes
|
343
496
|
|
344
|
-
|
497
|
+
## 0.2.1 2008-12-08
|
345
498
|
* 1 bug fix
|
346
499
|
* Fixed that HTTParty was borking ActiveSupport and as such Rails (thanks to Rob Sanheim)
|
347
500
|
|
348
|
-
|
501
|
+
## 0.2.0 2008-12-07
|
349
502
|
* 1 major enhancement
|
350
503
|
* Removed ActiveSupport as a dependency. Now requires json gem for json deserialization and uses an included class to do the xml parsing.
|
351
504
|
|
352
|
-
|
505
|
+
## 0.1.8 2008-11-30
|
353
506
|
* 3 major enhancements
|
354
507
|
* Moved base_uri normalization into request class and out of httparty module, fixing
|
355
508
|
the problem where base_uri was not always being normalized.
|
356
509
|
* Stupid simple support for HTTParty.get/post/put/delete. (jqr)
|
357
510
|
* Switched gem management to Echoe from newgem.
|
358
511
|
|
359
|
-
|
512
|
+
## 0.1.7 2008-11-30
|
360
513
|
* 1 major enhancement
|
361
514
|
* fixed multiple class definitions overriding each others options
|
362
515
|
|
363
|
-
|
516
|
+
## 0.1.6 2008-11-26
|
364
517
|
* 1 major enhancement
|
365
518
|
* now passing :query to set_form_data if post request to avoid content length errors
|
366
519
|
|
367
|
-
|
520
|
+
## 0.1.5 2008-11-14
|
368
521
|
* 2 major enhancements
|
369
522
|
* Refactored send request method out into its own object.
|
370
523
|
* Added :html format if you just want to do that.
|
371
524
|
|
372
|
-
|
525
|
+
## 0.1.4 2008-11-08
|
373
526
|
* 3 major enhancements:
|
374
527
|
* Removed some cruft
|
375
528
|
* Added ability to follow redirects automatically and turn that off (Alex Vollmer)
|
376
529
|
|
377
|
-
|
530
|
+
## 0.1.3 2008-08-22
|
378
531
|
|
379
532
|
* 3 major enhancements:
|
380
533
|
* Added http_proxy key for setting proxy server and port (francxk@gmail.com)
|
381
534
|
* Now raises exception when http error occurs (francxk@gmail.com)
|
382
535
|
* Changed auto format detection from file extension to response content type (Jay Pignata)
|
383
536
|
|
384
|
-
|
537
|
+
## 0.1.2 2008-08-09
|
385
538
|
|
386
539
|
* 1 major enhancement:
|
387
540
|
* default_params were not being appended to query string if option[:query] was blank
|
388
541
|
|
389
|
-
|
542
|
+
## 0.1.1 2008-07-30
|
390
543
|
|
391
544
|
* 2 major enhancement:
|
392
545
|
* Added :basic_auth key for options when making a request
|
393
546
|
* :query and :body both now work with query string or hash
|
394
547
|
|
395
|
-
|
548
|
+
## 0.1.0 2008-07-27
|
396
549
|
|
397
550
|
* 1 major enhancement:
|
398
551
|
* Initial release
|
data/Gemfile
CHANGED
@@ -2,7 +2,6 @@ source 'https://rubygems.org'
|
|
2
2
|
gemspec
|
3
3
|
|
4
4
|
gem 'rake'
|
5
|
-
gem 'fakeweb', '~> 1.3'
|
6
5
|
gem 'mongrel', '1.2.0.pre2'
|
7
6
|
|
8
7
|
group :development do
|
@@ -16,4 +15,10 @@ group :test do
|
|
16
15
|
gem 'simplecov', require: false
|
17
16
|
gem 'aruba'
|
18
17
|
gem 'cucumber', '~> 2.3'
|
18
|
+
gem 'webmock'
|
19
|
+
gem 'addressable'
|
20
|
+
end
|
21
|
+
|
22
|
+
group :development, :test do
|
23
|
+
gem 'pry'
|
19
24
|
end
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# httparty
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/jnunemaker/httparty.svg?branch=master)](https://travis-ci.org/jnunemaker/httparty)
|
4
|
+
|
5
|
+
Makes http fun again! Ain't no party like a httparty, because a httparty don't stop.
|
4
6
|
|
5
7
|
## Install
|
6
8
|
|
@@ -10,7 +12,7 @@ gem install httparty
|
|
10
12
|
|
11
13
|
## Requirements
|
12
14
|
|
13
|
-
* Ruby
|
15
|
+
* Ruby 2.3.0 or higher
|
14
16
|
* multi_xml
|
15
17
|
* You like to party!
|
16
18
|
|
@@ -28,7 +30,7 @@ class StackExchange
|
|
28
30
|
base_uri 'api.stackexchange.com'
|
29
31
|
|
30
32
|
def initialize(service, page)
|
31
|
-
@options = { query: {site: service, page: page} }
|
33
|
+
@options = { query: { site: service, page: page } }
|
32
34
|
end
|
33
35
|
|
34
36
|
def questions
|
@@ -46,7 +48,6 @@ puts stack_exchange.users
|
|
46
48
|
```
|
47
49
|
|
48
50
|
See the [examples directory](http://github.com/jnunemaker/httparty/tree/master/examples) for even more goodies.
|
49
|
-
|
50
51
|
## Command Line Interface
|
51
52
|
|
52
53
|
httparty also includes the executable `httparty` which can be
|
@@ -62,10 +63,9 @@ httparty "https://api.stackexchange.com/2.2/questions?site=stackoverflow"
|
|
62
63
|
|
63
64
|
## Help and Docs
|
64
65
|
|
65
|
-
* [Docs](docs
|
66
|
-
* https://
|
67
|
-
*
|
68
|
-
* http://stackoverflow.com/questions/tagged/httparty
|
66
|
+
* [Docs](https://github.com/jnunemaker/httparty/tree/master/docs)
|
67
|
+
* https://github.com/jnunemaker/httparty/discussions
|
68
|
+
* https://www.rubydoc.info/github/jnunemaker/httparty
|
69
69
|
|
70
70
|
## Contributing
|
71
71
|
|