aliyunsdkcore 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4de63d69bfea414db0b9f7572bd2af0c5c68f903ac91a7d367877601aabe01b1
4
- data.tar.gz: 871939dccdcaf6d85c22b020aef299d48ccb3b8c69cb455431dce80abb433cc8
3
+ metadata.gz: db440cd806945cb8cfac4ac73dbeb07483105a899209211bf17d29204a89e78a
4
+ data.tar.gz: f2863a87f8c8c32d41a3113b645da0e5c2901c60f72367227e95bcd4ecb9fa02
5
5
  SHA512:
6
- metadata.gz: cca025b973042b83aee3152d5d9feb295303412cd9c2fa3c834ba4e5dc6bc798ebc9625379d7bcac2672dadc97fd668374a99e996986394cbad55fdcd165ee70
7
- data.tar.gz: 7dd142a373799e3b888d17bcf025df9e6cc4e919bea7875a2186612e9caa39cfea8e6987c4cbe7b70d32e7170a2f4612fbbf595f24ac10897ca59f5220d795c6
6
+ metadata.gz: f2d0eb4550ef766cbcc24a377eb179c602b80b77270062eef8726bf21521a98793614ab5bb74dc0491781d382c2129c360333d9e54f0296aa24edc5b75024917
7
+ data.tar.gz: 108a4cf118ad66f18b83bce4cd082eaadedd92e8c394a31c0a8a503e36c72ce28ffb2c5d7a3e8dfc3b0ce39dc17c52c92e2c2717a9dbbd5b409bbca2767adbc0
@@ -2,7 +2,7 @@ require 'aliyunsdkcore/rpc_client'
2
2
  require 'aliyunsdkcore/roa_client'
3
3
 
4
4
  module AliyunSDKCore
5
- VERSION = "0.0.12"
5
+ VERSION = "0.0.13"
6
6
  DEFAULT_UA = "AlibabaCloud (#{Gem::Platform.local.os}; " +
7
7
  "#{Gem::Platform.local.cpu}) Ruby/#{RUBY_VERSION} Core/#{VERSION}"
8
8
  end
@@ -26,11 +26,17 @@ module AliyunSDKCore
26
26
 
27
27
  response = connection.send(method.downcase) do |request|
28
28
  request.url uri, params
29
- if body.try(:any?) || body
30
- request_body = body.to_json
31
- request.body = request_body
29
+ if body
30
+ if mix_headers['content-type'].start_with? 'application/json'
31
+ request_body = body.to_json
32
+ elsif mix_headers['content-type'].start_with? 'application/x-www-form-urlencoded'
33
+ request_body = URI.encode_www_form(body)
34
+ else
35
+ request_body = body
36
+ end
32
37
  mix_headers['content-md5'] = Digest::MD5.base64digest request_body
33
38
  mix_headers['content-length'] = request_body.length.to_s
39
+ request.body = request_body
34
40
  end
35
41
  string2sign = string_to_sign(method, uri, mix_headers, params)
36
42
  mix_headers.merge!(authorization: authorization(string2sign))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyunsdkcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alibaba Cloud SDK