lib/api-client/dispatcher/net-http.rb in api-client-2.0.0.rc2 vs lib/api-client/dispatcher/net-http.rb in api-client-2.0.0

- old
+ new

@@ -8,43 +8,43 @@ # @param [String] url of the api request. # @param [Hash] header attributes of the request. # @return [HTTP] the response object. def self.get(url, header = {}) initialize_connection(url) - call { @http.get(@uri.request_uri, { 'Content-Type' => 'application/json' }.merge(header)) } + call { @http.get(@uri.request_uri, ApiClient.config.header.merge(header)) } end # Make a post request and returns it. # # @param [String] url of the api request. # @param [Hash] args attributes of object. # @param [Hash] header attributes of the request. # @return [HTTP] the response object. def self.post(url, args, header = {}) initialize_connection(url) - call { @http.post(@uri.request_uri, args.to_json, { 'Content-Type' => 'application/json' }.merge(header)) } + call { @http.post(@uri.request_uri, args.to_json, ApiClient.config.header.merge(header)) } end # Make a put request and returns it. # # @param [String] url of the api request. # @param [Hash] args attributes of object. # @param [Hash] header attributes of the request. # @return [HTTP] the response object. def self.put(url, args, header = {}) initialize_connection(url) - call { @http.put(@uri.request_uri, args.to_json, { 'Content-Type' => 'application/json' }.merge(header)) } + call { @http.put(@uri.request_uri, args.to_json, ApiClient.config.header.merge(header)) } end # Make a patch request and returns it. # # @param [String] url of the api request. # @param [Hash] args attributes of object. # @param [Hash] header attributes of the request. # @return [HTTP] the response object. def self.patch(url, args, header = {}) initialize_connection(url) - call { @http.patch(@uri.request_uri, args.to_json, { 'Content-Type' => 'application/json' }.merge(header)) } + call { @http.patch(@uri.request_uri, args.to_json, ApiClient.config.header.merge(header)) } end # Make a delete request and returns it. # # @param [String] url of the api request.