almapi 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/almapi/almapi.rb +5 -3
- data/lib/almapi/version.rb +1 -1
- 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: cb6918b7e7c9f7ebd49f2255ce6d447e9b3ac8608a2847790b9bde4434325622
|
4
|
+
data.tar.gz: 0b3fe11572d763268e2ae1be8c2b42a77a816d8ea4687855389ba93fb654624e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94f9e303a9ccd2fa37fe182c8b1b1d5039cda9f5f9c551fee3706dc9f6520aee4567f8600f8148b48179a9818583687be6de25555b773d6b2d4021c39501a2ae
|
7
|
+
data.tar.gz: cee651945fb60c85d80b364782d8485c06305a805ebcc16e3e6b3e53f6684da98695844196a3ea43edd09cf389dc3ef013323766594a9d6e4743c72a4c64a3d1
|
data/lib/almapi/almapi.rb
CHANGED
@@ -71,7 +71,7 @@ module Almapi
|
|
71
71
|
# @param data [String] : an XML string containing data to post.
|
72
72
|
# @return [Response] : the resulting response
|
73
73
|
def post(resource, data)
|
74
|
-
url_api = resource
|
74
|
+
url_api = "#{@uri_base}#{resource}"
|
75
75
|
handle_response(@conn.post(url_api, data.to_s))
|
76
76
|
end
|
77
77
|
|
@@ -82,9 +82,10 @@ module Almapi
|
|
82
82
|
# @param data [String] : an XML string containing data to put.
|
83
83
|
# @return [Response] : the resulting response. If error occurs, raises an AlmapiError
|
84
84
|
def put(resource, data)
|
85
|
-
url_api = resource
|
85
|
+
url_api = "#{@uri_base}#{resource}"
|
86
|
+
puts url_api
|
86
87
|
begin
|
87
|
-
handle_response(@conn.put(url_api, data.to_s))
|
88
|
+
handle_response(@conn.put(url_api, data.to_s, "Content-Type" => "application/xml"))
|
88
89
|
rescue StandardError => e
|
89
90
|
puts e
|
90
91
|
end
|
@@ -115,6 +116,7 @@ module Almapi
|
|
115
116
|
else
|
116
117
|
# Request has been correctly handled but cannot succeed
|
117
118
|
raise Almapi::AlmapiError, "AlmapiError : #{response.status} -> #{response.body}"
|
119
|
+
p @conn
|
118
120
|
end
|
119
121
|
end
|
120
122
|
end
|
data/lib/almapi/version.rb
CHANGED