httparty 0.13.0 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.editorconfig +18 -0
- data/.github/workflows/ci.yml +26 -0
- data/.gitignore +4 -0
- data/.rubocop.yml +92 -0
- data/.rubocop_todo.yml +124 -0
- data/CONTRIBUTING.md +23 -0
- data/Changelog.md +557 -0
- data/Gemfile +15 -3
- data/Guardfile +4 -3
- data/README.md +24 -25
- data/Rakefile +5 -7
- data/bin/httparty +20 -14
- data/docs/README.md +191 -0
- data/examples/README.md +89 -0
- data/examples/aaws.rb +10 -6
- data/examples/basic.rb +6 -10
- data/examples/body_stream.rb +14 -0
- data/examples/crack.rb +2 -2
- data/examples/custom_parsers.rb +6 -5
- data/examples/delicious.rb +8 -8
- data/examples/google.rb +2 -2
- data/examples/headers_and_user_agents.rb +7 -3
- data/examples/idn.rb +10 -0
- data/examples/logging.rb +36 -0
- data/examples/microsoft_graph.rb +52 -0
- data/examples/multipart.rb +22 -0
- data/examples/nokogiri_html_parser.rb +0 -3
- data/examples/peer_cert.rb +9 -0
- data/examples/rescue_json.rb +17 -0
- data/examples/rubyurl.rb +3 -3
- data/examples/stackexchange.rb +24 -0
- data/examples/stream_download.rb +26 -0
- data/examples/tripit_sign_in.rb +20 -9
- data/examples/twitter.rb +7 -7
- data/examples/whoismyrep.rb +1 -1
- data/httparty.gemspec +13 -9
- data/lib/httparty/connection_adapter.rb +105 -25
- data/lib/httparty/cookie_hash.rb +10 -9
- data/lib/httparty/decompressor.rb +102 -0
- data/lib/httparty/exceptions.rb +8 -2
- data/lib/httparty/hash_conversions.rb +39 -19
- data/lib/httparty/headers_processor.rb +32 -0
- data/lib/httparty/logger/apache_formatter.rb +47 -0
- data/lib/httparty/logger/curl_formatter.rb +93 -0
- data/lib/httparty/logger/logger.rb +22 -10
- 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 +76 -25
- data/lib/httparty/parser.rb +28 -15
- data/lib/httparty/request/body.rb +105 -0
- data/lib/httparty/request/multipart_boundary.rb +13 -0
- data/lib/httparty/request.rb +218 -130
- data/lib/httparty/response/headers.rb +23 -19
- data/lib/httparty/response.rb +99 -15
- 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 +191 -83
- data/website/css/common.css +1 -1
- data/website/index.html +3 -3
- metadata +50 -120
- data/.travis.yml +0 -7
- data/History +0 -303
- data/features/basic_authentication.feature +0 -20
- data/features/command_line.feature +0 -7
- data/features/deals_with_http_error_codes.feature +0 -26
- data/features/digest_authentication.feature +0 -20
- data/features/handles_compressed_responses.feature +0 -27
- data/features/handles_multiple_formats.feature +0 -57
- data/features/steps/env.rb +0 -22
- data/features/steps/httparty_response_steps.rb +0 -52
- data/features/steps/httparty_steps.rb +0 -35
- data/features/steps/mongrel_helper.rb +0 -94
- data/features/steps/remote_service_steps.rb +0 -74
- data/features/supports_redirection.feature +0 -22
- data/features/supports_timeout_option.feature +0 -13
- data/lib/httparty/core_extensions.rb +0 -32
- data/lib/httparty/logger/apache_logger.rb +0 -22
- data/lib/httparty/logger/curl_logger.rb +0 -48
- 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 -298
- data/spec/httparty/cookie_hash_spec.rb +0 -83
- data/spec/httparty/exception_spec.rb +0 -23
- data/spec/httparty/logger/apache_logger_spec.rb +0 -26
- data/spec/httparty/logger/curl_logger_spec.rb +0 -18
- data/spec/httparty/logger/logger_spec.rb +0 -22
- data/spec/httparty/net_digest_auth_spec.rb +0 -152
- data/spec/httparty/parser_spec.rb +0 -165
- data/spec/httparty/request_spec.rb +0 -631
- data/spec/httparty/response_spec.rb +0 -221
- data/spec/httparty/ssl_spec.rb +0 -74
- data/spec/httparty_spec.rb +0 -764
- data/spec/spec.opts +0 -2
- data/spec/spec_helper.rb +0 -37
- 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 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9dccd9b1a1fa3f98ca96da312ccdf19371418815a556b1443acac322a8ae4e15
|
4
|
+
data.tar.gz: 61f75235d1dcf4e1e38cbab62869aeeff28de9d0dc27fad30c7ca11d6355cd0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e47fce0ce8b6c4fe97ee0335b4f0544bc039755f12f0c2aac9f47e901739fd172390a3dc01f070d6799b1af335293b5d09a66514deb0810dfafc37f25d2f3c81
|
7
|
+
data.tar.gz: 9aa37800410a58a60ca751de44eed1026514b26c408a1f890b48a8f0049c814052a70a55343d3798c3d4d59ca9b157257c1fa83240200d283ba374a9b62db2ef
|
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,26 @@
|
|
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
|
+
- '3.0' # Quoted, to avoid YAML float 3.0 interplated to "3"
|
15
|
+
- 3.1
|
16
|
+
- 3.2
|
17
|
+
steps:
|
18
|
+
- name: Check out repository code
|
19
|
+
uses: actions/checkout@v3
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
bundler-cache: true # Run "bundle install", and cache the result automatically.
|
25
|
+
- name: Run Rake
|
26
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
# Offense count: 963
|
4
|
+
# Cop supports --auto-correct.
|
5
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
6
|
+
Style/StringLiterals:
|
7
|
+
Enabled: false
|
8
|
+
|
9
|
+
# Offense count: 327
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
|
12
|
+
Style/SpaceInsideHashLiteralBraces:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
# Offense count: 33
|
16
|
+
# Cop supports --auto-correct.
|
17
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
18
|
+
Style/SpaceInsideBlockBraces:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
# Offense count: 1
|
22
|
+
# Cop supports --auto-correct.
|
23
|
+
Style/SpaceBeforeSemicolon:
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
# Offense count: 20
|
27
|
+
# Cop supports --auto-correct.
|
28
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
29
|
+
Style/SignalException:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
# Offense count: 1
|
33
|
+
# Configuration parameters: Methods.
|
34
|
+
Style/SingleLineBlockParams:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
# Offense count: 6
|
38
|
+
# Cop supports --auto-correct.
|
39
|
+
Style/PerlBackrefs:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
# Offense count: 2
|
43
|
+
# Cop supports --auto-correct.
|
44
|
+
# Configuration parameters: AllowAsExpressionSeparator.
|
45
|
+
Style/Semicolon:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
# Offense count: 77
|
49
|
+
# Cop supports --auto-correct.
|
50
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
51
|
+
Style/BracesAroundHashParameters:
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
# Offense count: 36
|
55
|
+
Style/Documentation:
|
56
|
+
Enabled: false
|
57
|
+
|
58
|
+
# Offense count: 6
|
59
|
+
# Cop supports --auto-correct.
|
60
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
|
61
|
+
Style/RegexpLiteral:
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
# Offense count: 5
|
65
|
+
# Cop supports --auto-correct.
|
66
|
+
Style/NumericLiterals:
|
67
|
+
MinDigits: 6
|
68
|
+
|
69
|
+
# Offense count: 4
|
70
|
+
# Cop supports --auto-correct.
|
71
|
+
Lint/UnusedMethodArgument:
|
72
|
+
Enabled: false
|
73
|
+
|
74
|
+
# Offense count: 11
|
75
|
+
# Cop supports --auto-correct.
|
76
|
+
Lint/UnusedBlockArgument:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
# Offense count: 1
|
80
|
+
Lint/Void:
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
# Offense count: 22
|
84
|
+
# Cop supports --auto-correct.
|
85
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
86
|
+
Style/IndentHash:
|
87
|
+
Enabled: false
|
88
|
+
|
89
|
+
# Offense count: 7
|
90
|
+
# Configuration parameters: MinBodyLength.
|
91
|
+
Style/GuardClause:
|
92
|
+
Enabled: false
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2015-04-24 07:22:28 +0200 using RuboCop version 0.30.0.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 33
|
9
|
+
Lint/AmbiguousRegexpLiteral:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
# Offense count: 1
|
13
|
+
# Configuration parameters: AlignWith, SupportedStyles.
|
14
|
+
Lint/EndAlignment:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
# Offense count: 1
|
18
|
+
Lint/SuppressedException:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
# Offense count: 5
|
22
|
+
Lint/UselessAssignment:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
# Offense count: 23
|
26
|
+
Metrics/AbcSize:
|
27
|
+
Max: 86
|
28
|
+
|
29
|
+
# Offense count: 1
|
30
|
+
# Configuration parameters: CountComments.
|
31
|
+
Metrics/ClassLength:
|
32
|
+
Max: 285
|
33
|
+
|
34
|
+
# Offense count: 8
|
35
|
+
Metrics/CyclomaticComplexity:
|
36
|
+
Max: 17
|
37
|
+
|
38
|
+
# Offense count: 332
|
39
|
+
# Configuration parameters: AllowURI, URISchemes.
|
40
|
+
Metrics/LineLength:
|
41
|
+
Max: 266
|
42
|
+
|
43
|
+
# Offense count: 17
|
44
|
+
# Configuration parameters: CountComments.
|
45
|
+
Metrics/MethodLength:
|
46
|
+
Max: 39
|
47
|
+
|
48
|
+
# Offense count: 8
|
49
|
+
Metrics/PerceivedComplexity:
|
50
|
+
Max: 20
|
51
|
+
|
52
|
+
# Offense count: 1
|
53
|
+
Style/AccessorMethodName:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
# Offense count: 1
|
57
|
+
Style/AsciiComments:
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
# Offense count: 14
|
61
|
+
# Cop supports --auto-correct.
|
62
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
|
63
|
+
Style/BlockDelimiters:
|
64
|
+
Enabled: false
|
65
|
+
|
66
|
+
# Offense count: 2
|
67
|
+
Style/CaseEquality:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
# Offense count: 3
|
71
|
+
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
|
72
|
+
Style/CaseIndentation:
|
73
|
+
Enabled: false
|
74
|
+
|
75
|
+
# Offense count: 4
|
76
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
77
|
+
Style/ClassAndModuleChildren:
|
78
|
+
Enabled: false
|
79
|
+
|
80
|
+
# Offense count: 7
|
81
|
+
Style/ConstantName:
|
82
|
+
Enabled: false
|
83
|
+
|
84
|
+
# Offense count: 2
|
85
|
+
Style/EachWithObject:
|
86
|
+
Enabled: false
|
87
|
+
|
88
|
+
# Offense count: 2
|
89
|
+
# Cop supports --auto-correct.
|
90
|
+
Style/ElseAlignment:
|
91
|
+
Enabled: false
|
92
|
+
|
93
|
+
# Offense count: 3
|
94
|
+
# Cop supports --auto-correct.
|
95
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
96
|
+
Style/FirstParameterIndentation:
|
97
|
+
Enabled: false
|
98
|
+
|
99
|
+
# Offense count: 2
|
100
|
+
# Cop supports --auto-correct.
|
101
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
|
102
|
+
Style/HashSyntax:
|
103
|
+
Enabled: false
|
104
|
+
|
105
|
+
# Offense count: 7
|
106
|
+
# Cop supports --auto-correct.
|
107
|
+
# Configuration parameters: MaxLineLength.
|
108
|
+
Style/IfUnlessModifier:
|
109
|
+
Enabled: false
|
110
|
+
|
111
|
+
# Offense count: 11
|
112
|
+
# Cop supports --auto-correct.
|
113
|
+
Style/Lambda:
|
114
|
+
Enabled: false
|
115
|
+
|
116
|
+
# Offense count: 1
|
117
|
+
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
|
118
|
+
Style/Next:
|
119
|
+
Enabled: false
|
120
|
+
|
121
|
+
# Offense count: 2
|
122
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
123
|
+
Style/RaiseArgs:
|
124
|
+
Enabled: false
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
* Contributions will not be accepted without tests.
|
4
|
+
* Please post unconfirmed bugs to the mailing list first: https://groups.google.com/forum/#!forum/httparty-gem
|
5
|
+
* Don't change the version. The maintainers will handle that when they release.
|
6
|
+
* Always provide as much information and reproducibility as possible when filing an issue or submitting a pull request.
|
7
|
+
|
8
|
+
## Workflow
|
9
|
+
|
10
|
+
* Fork the project.
|
11
|
+
* Run `bundle`
|
12
|
+
* Run `bundle exec rake`
|
13
|
+
* Make your feature addition or bug fix.
|
14
|
+
* Add tests for it. This is important so I don't break it in a future version unintentionally.
|
15
|
+
* Run `bundle exec rake` (No, REALLY :))
|
16
|
+
* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself in another branch so I can ignore when I pull)
|
17
|
+
* Send me a pull request. Bonus points for topic branches.
|
18
|
+
|
19
|
+
## Help and Docs
|
20
|
+
|
21
|
+
* https://groups.google.com/forum/#!forum/httparty-gem
|
22
|
+
* http://stackoverflow.com/questions/tagged/httparty
|
23
|
+
* http://rdoc.info/projects/jnunemaker/httparty
|