lib/calx_client.rb in calx_client-0.1.0 vs lib/calx_client.rb in calx_client-0.1.1

- old
+ new

@@ -36,11 +36,11 @@ end private def get(request_uri, params = {}) - request_uri += "?#{encode_params(params)}" unless params.nil? + request_uri += "?#{encode_params(params)}" unless params.empty? uri = URI(@host + request_uri) request = Net::HTTP::Get.new(uri.request_uri) request(uri, request) end @@ -94,11 +94,10 @@ response.body end end def error_response_message(response, uri) - message = "#{response.code} response from #{uri.host}" - message + " | Response body: #{JSON.parse(response.body)}" unless response.body.nil? + "#{response.code} response from #{uri.host}" end def http(uri) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = uri.is_a?(URI::HTTPS)