lazop_api_client 1.2.0 → 1.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 666e78eef65788b7475af650f11f113fdbe2133f42d34023d9bf26ac002c3ede
4
- data.tar.gz: 28a07ef20de8e1d5e8cb8d51d7a9888fd23c5b0c2ebb1fa2d6ff7ca259ba22f8
3
+ metadata.gz: 12b7631a423920bb869156e267849e16b99591f45cf72db1995093fc7a192188
4
+ data.tar.gz: ed06925d38342a9f2ffd6f9a6736e31d74bd51a9130e89c67ba86baef5f786c2
5
5
  SHA512:
6
- metadata.gz: a5022599957f6aeb82fd790d22801445e6c00a3e7876ff415f2f5cb64923988e1af96af8dbf01ed7cf7de3a3c158d0d5aedccab4b014d4cd32a5387b8d598485
7
- data.tar.gz: 6dd2a9b0fda6479297e5fd087a0e81500e8bd156e1727cd12ff53b6d8ad9a6abd6acf1bce32efb4f9c15e23e1f7432ba259f6e9b69bbd74703bfe0f1f5a8e7b5
6
+ metadata.gz: c67ddd321fca4547dfb51e39d5fbbf5ccb78bf4e4cbe5a7cd032b2dc04999ea7d25c6fc009754ac5fe43a501e486f1645ac045e3f8a0168d785ee9ec60863a7b
7
+ data.tar.gz: 62b05e93998e43e46799509da34c3f849fc958b5782a4ee29a2f17066253ed6f2659daaf71d612c5ee3010c03428f6fb9028a5913db54e693d86bd8166159ffc
data/README.md CHANGED
@@ -15,6 +15,8 @@ The lazop_api_client gem depends on these other gems for usage at runtime:
15
15
 
16
16
  ## Release Changes
17
17
 
18
+ 1.2.2 : remove some logs
19
+ 1.2.1 : use CGI:encode to encode get params
18
20
  1.2.0 : change sign method from hmac-md5 to hmac-sha256
19
21
  1.1.0 : Change API Sign algorithms
20
22
 
@@ -44,7 +46,7 @@ Or install it yourself as:
44
46
  require 'lazop_api_client'
45
47
 
46
48
  # init a REST Client
47
- client = LazopApiClient::Client.new('http://api.lazada.test/rest','***AppKey***','***SecretKey**')
49
+ client = LazopApiClient::Client.new('https://api.lazada.test/rest','***AppKey***','***SecretKey**')
48
50
 
49
51
  # init a API Request for api : /xiaoxuan/mockfileupload
50
52
  request = LazopApiClient::Request.new('/xiaoxuan/mockfileupload')
@@ -1,3 +1,3 @@
1
1
  module LazopApiClient
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -6,6 +6,7 @@ require "lazop_api_client/version"
6
6
  require 'rest-client'
7
7
  require 'json'
8
8
  require 'OpenSSL'
9
+ require 'cgi'
9
10
 
10
11
  module LazopApiClient
11
12
 
@@ -60,18 +61,20 @@ module LazopApiClient
60
61
  param_str += '&'
61
62
  param_str += k.to_s()
62
63
  param_str += '='
63
- param_str += v.to_s()
64
+ param_str += CGI.escape(v.to_s())
64
65
  end
65
66
  end
66
67
 
67
- puts url + param_str
68
-
69
68
  res = JSON.parse(RestClient.get(url + param_str, header_params))
70
69
 
71
70
  return res
72
71
 
73
72
  end
74
73
 
74
+ def url_encode(str)
75
+ return str.gsub!(/[^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]/n) { |x| x = format("%%%x", x[0])}
76
+ end
77
+
75
78
  def perform_post url, api_params,file_params,header_params
76
79
 
77
80
  all_params = api_params
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazop_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - xuteng.xt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-23 00:00:00.000000000 Z
11
+ date: 2018-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler