lib/tops_connect/client.rb in tops_connect-0.7.1 vs lib/tops_connect/client.rb in tops_connect-0.7.2
- old
+ new
@@ -50,23 +50,23 @@
def put(endpoint, body: {}, headers: {}, query: {})
response = self.class.put(
"/#{TopsConnect.configuration.zone}/api#{endpoint}",
query: query.merge('subscription-key' => @subscription_key),
headers: headers.merge('community-api-key' => @community_api_key),
- body: body
+ body: body.to_json
)
- raise_exception(response) unless response.code == 204
+ raise_exception(response) unless response.code == 200
response.parsed_response
end
def post(endpoint, body: {}, headers: {}, query: {})
response = self.class.post(
"/#{TopsConnect.configuration.zone}/api#{endpoint}",
query: query.merge('subscription-key' => @subscription_key),
headers: headers.merge('community-api-key' => @community_api_key),
- body: body
+ body: body.to_json
)
raise_exception(response) unless response.code == 200
response.parsed_response