Commit 76d3349f authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

adding net-http-persistent adapter and multipart middleware

parent 1df1a3c1
......@@ -8,6 +8,7 @@ gemspec
gem 'json'
gem 'resource_kit'
gem 'faraday'
gem 'net-http-persistent'
group :development, :spec do
gem 'minitest', '~> 5.8.3'
......
......@@ -11,7 +11,10 @@ module Dspace
def connection
Faraday.new(connection_options) do |req|
req.adapter :net_http
req.request :multipart
req.request :url_encoded
req.use Faraday::Response::Logger, Logger.new('faraday.log')
req.adapter :net_http_persistent
end
end
......@@ -60,7 +63,8 @@ module Dspace
url: @dspace_api || DSPACE_API,
headers: {
content_type: 'application/json',
'rest-dspace-token' => access_token.to_s
'rest-dspace-token' => access_token.to_s,
user_agent: "dspace-rest-client #{Dspace::VERSION}"
}
}
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment