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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fae996cc6ba2691735a5acde3ce4a588a3ac5c0ecf840e688b71c57e0e1f6d1
4
- data.tar.gz: 6375a09a9a8447e74668a7d553285ac3bf495e0aa5859373d6292d1b06f1621f
3
+ metadata.gz: cb6918b7e7c9f7ebd49f2255ce6d447e9b3ac8608a2847790b9bde4434325622
4
+ data.tar.gz: 0b3fe11572d763268e2ae1be8c2b42a77a816d8ea4687855389ba93fb654624e
5
5
  SHA512:
6
- metadata.gz: 490cfab30075877e0faf4670b6bb65a12f338dd07d10e55a274f6e09cc75ec9206fec95ddc59c22d9c1f3a8012259aec2bda4c65cd25958b1a87b0823d2be255
7
- data.tar.gz: b061fcb46452f5b56fc9924a0df40a711f8a1b9da4b1c28367aff234da74f685017e926354639d7458d8212d7714b36680175f7f883ec02ff7c91cc0884b3b4a
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.to_s
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.to_s
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Almapi
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: almapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - jszenb