lib/moysklad/client.rb in moysklad-0.4.8 vs lib/moysklad/client.rb in moysklad-0.4.9
- old
+ new
@@ -9,12 +9,10 @@
class Moysklad::Client
URL ='https://api.moysklad.ru/api/remap/1.2/'
def initialize login: nil, password: nil, logger: nil
@client = Faraday.new URL do |conn|
- # Needs for downloads
- conn.use FaradayMiddleware::FollowRedirects
unless logger.nil?
conn.response :detailed_logger, logger
conn.request :curl, logger, :info
end
conn.request :gzip
@@ -27,14 +25,9 @@
conn.request(:authorization, :basic, login, password)
end
conn.adapter Faraday.default_adapter
end
- end
-
- def download(path, filename)
- response = client.get path
- File.open(filename, 'wb') { |fp| fp.write(response.body) }
end
def get path, params={}
logger.debug "Client: GET #{path} #{params}"
parse_response client.get path, params