sp-seutils 0.0.9 → 0.0.10
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/lib/sp-seutils.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c67129e6e0aed8d5956e61b8bdf885f3235575ba18b895a2857afeee5429674
|
|
4
|
+
data.tar.gz: ee008084155d2fe2c75edeaa4f82820ac6d4e086c0f9fe7b853e98f843f3c2ed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8c5aa2d03b28c525c443a5d406ae63919ee889b582ef327c9ab492f77f7e937bdf448a93ed6f300e7afdc09d9e2adc8cf2a194da3b250f5db02f46e2f68cd45
|
|
7
|
+
data.tar.gz: dc9e973e3346b0c15fe541bb414ab213c253e0c1792baa94990ff655c4e51d0c06736e374189315fb6b7848df89121744da7718722f00a6b95c1b5654a1084a9
|
data/lib/sp-seutils.rb
CHANGED
|
@@ -684,11 +684,14 @@ end
|
|
|
684
684
|
def self.api_post(org,api,user,password,client_id,client_secret,data=nil,token=nil)
|
|
685
685
|
api = "api/"+api
|
|
686
686
|
url = cc_url(URI.join(org, api).to_s)
|
|
687
|
+
data = JSON.generate(data) if data.is_a? Hash
|
|
687
688
|
rest_result = nil
|
|
688
689
|
token = token || idn_oauth(org,user,password,client_id,client_secret)
|
|
689
690
|
redirected_url = nil
|
|
690
|
-
RestClient.post(url,
|
|
691
|
-
|
|
691
|
+
RestClient.post(url, data, {'Authorization' => "Bearer #{token}",
|
|
692
|
+
'X-CSRF-Token' => 'nocheck',
|
|
693
|
+
"Accept"=>"*/*",
|
|
694
|
+
'Content-Type' => 'application/json'
|
|
692
695
|
}) do |response, request, result, &block|
|
|
693
696
|
rest_result = handle_rest_response(response, request, result, &block)
|
|
694
697
|
end
|