httmultiparty 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,9 +42,9 @@ module HTTMultiParty
42
42
  module ClassMethods
43
43
  def post(path, options={})
44
44
  method = Net::HTTP::Post
45
- if query_contains_files?(options[:query])
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
- if query_contains_files?(options[:query])
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.2'
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: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
- version: "0.2"
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-01-25 00:00:00 -08:00
17
+ date: 2011-02-21 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency