httmultiparty 0.2 → 0.3
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.
- data/lib/httmultiparty.rb +4 -4
- data/lib/httmultiparty/version.rb +2 -2
- metadata +4 -4
data/lib/httmultiparty.rb
CHANGED
@@ -42,9 +42,9 @@ module HTTMultiParty
|
|
42
42
|
module ClassMethods
|
43
43
|
def post(path, options={})
|
44
44
|
method = Net::HTTP::Post
|
45
|
-
|
45
|
+
options[:body] ||= options.delete(:query)
|
46
|
+
if query_contains_files?(options[:body])
|
46
47
|
method = MultipartPost
|
47
|
-
options[:body] = options.delete(:query)
|
48
48
|
options[:query_string_normalizer] = HTTMultiParty::QUERY_STRING_NORMALIZER
|
49
49
|
end
|
50
50
|
perform_request method, path, options
|
@@ -52,9 +52,9 @@ module HTTMultiParty
|
|
52
52
|
|
53
53
|
def put(path, options={})
|
54
54
|
method = Net::HTTP::Put
|
55
|
-
|
55
|
+
options[:body] ||= options.delete(:query)
|
56
|
+
if query_contains_files?(options[:body])
|
56
57
|
method = MultipartPut
|
57
|
-
options[:body] = options.delete(:query)
|
58
58
|
options[:query_string_normalizer] = HTTMultiParty::QUERY_STRING_NORMALIZER
|
59
59
|
end
|
60
60
|
perform_request method, path, options
|
@@ -1,3 +1,3 @@
|
|
1
1
|
module HTTMultiParty
|
2
|
-
VERSION = '0.
|
3
|
-
end
|
2
|
+
VERSION = '0.3'
|
3
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httmultiparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: "0.
|
8
|
+
- 3
|
9
|
+
version: "0.3"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Johannes Wagener
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-02-21 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|