lib/zephyr_ruby/client.rb in zephyr_ruby-0.4.0 vs lib/zephyr_ruby/client.rb in zephyr_ruby-0.5.0
- old
+ new
@@ -14,10 +14,11 @@
require_relative 'resource/test_executions'
require_relative 'resource/test_plans'
require_relative 'connection'
require 'faraday'
+require 'faraday/multipart'
require 'json'
module ZephyrRuby
# Client provides methods for interacting with all zephyr scale endpoints
class Client
@@ -37,10 +38,14 @@
include ZephyrRuby::Connection
def initialize(api_token)
@base_url = 'https://api.zephyrscale.smartbear.com/v2'
@api_token = api_token
- @client = Faraday.new(@base_url, builder: build_middleware)
+ @client = Faraday.new(@base_url) do |f|
+ f.request :multipart
+ f.request :url_encoded
+ f.adapter Faraday.default_adapter
+ end
@headers = {
'Authorization' => "Bearer #{@api_token}",
'Content-Type' => 'application/json'
}
end