I have a method like this:
def make_request(path, params, body)
raise ArgumentError.new('Endpoint not set!') if url.nil?
conditions = {url: url}
conditions[:params] = params unless params.blank?
connection = Faraday::Connection.new(conditions)
connection.run_request(:get, path, body, {'Content-Type' => 'application/json'})
end
Then how can I add keep-alive there? Also, since I instantiate a connection object everytime I call this method(url might be different), does the keep-alive parameter still work?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.