lib/dkron-ruby/api_client.rb in dkron-ruby-1.0.0 vs lib/dkron-ruby/api_client.rb in dkron-ruby-3.0.0

- old
+ new

@@ -1,23 +1,23 @@ =begin #Dkron REST API -#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`. Dkron implements a RESTful JSON API over HTTP to communicate with software clients. Dkron listens in port `8080` by default. All examples in this section assume that you're using the default port. Default API responses are unformatted JSON add the `pretty=true` param to format the response. +#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`. Dkron implements a RESTful JSON API over HTTP to communicate with software clients. Dkron listens in port `8080` by default. All examples in this section assume that you're using the default port. Default API responses are unformatted JSON add the `pretty=true` param to format the response. -OpenAPI spec version: 2.2 +OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.13 +Swagger Codegen version: 2.4.17 =end require 'date' require 'json' require 'logger' require 'tempfile' require 'typhoeus' -require 'uri' +require 'addressable/uri' module Dkron class ApiClient # The Configuration object holding settings to be used in the API client. attr_accessor :config @@ -61,11 +61,11 @@ # Errors from libcurl will be made visible here fail ApiError.new(:code => 0, :message => response.return_message) else fail ApiError.new(:code => response.code, - :response_headers => response.headers, + :response_headers => response.headers.to_h, :response_body => response.body), response.status_message end end @@ -263,10 +263,10 @@ end def build_request_url(path) # Add leading and trailing slashes to path path = "/#{path}".gsub(/\/+/, '/') - URI.encode(@config.base_url + path) + Addressable::URI.encode(@config.base_url + path) end # Builds the HTTP request body # # @param [Hash] header_params Header parameters