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 +4 -4
- data/README.md +3 -1
- data/lib/lazop_api_client/version.rb +1 -1
- data/lib/lazop_api_client.rb +6 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12b7631a423920bb869156e267849e16b99591f45cf72db1995093fc7a192188
|
4
|
+
data.tar.gz: ed06925d38342a9f2ffd6f9a6736e31d74bd51a9130e89c67ba86baef5f786c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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('
|
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')
|
data/lib/lazop_api_client.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2018-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|