lib/stream/client.rb in stream-ruby-2.2.2 vs lib/stream/client.rb in stream-ruby-2.2.3
- old
+ new
@@ -105,10 +105,13 @@
end
def make_http_request(method, relative_url, params=nil, data=nil, headers=nil)
headers['Content-Type'] = 'application/json'
headers['User-Agent'] = "stream-ruby-#{Stream::VERSION}"
- response = self.class.send(method, relative_url, :headers => headers, :query => params, :body => data.to_json )
+ if ['post', 'put'].include? method.to_s
+ body = data.to_json
+ end
+ response = self.class.send(method, relative_url, :headers => headers, :query => params, :body => body )
case response.code
when 200..203
return response
when 204...600
raise StreamApiResponseException, "#{response['exception']} details: #{response['detail']}"