lib/communication.rb in mxhero-api-1.1.1 vs lib/communication.rb in mxhero-api-1.1.2

- old
+ new

@@ -1,10 +1,14 @@ +require 'httpclient' +require 'json' +require_relative 'response' + module MxHero module API module Communication - - # Make a HTTP call + + # Make a HTTP call # @param method [Symbol] indicate the HTTP verb (:get, :post, :put, etc) # @param url [String] # @param body [String] (default: nil) # @param [Hash] more_options # @option more_options [Boolean] :throw_exception (default: true) throw exception if the response status are between 500 and 600 @@ -23,10 +27,10 @@ # Default headers def headers @headers ||= { 'Accept' => 'application/json', 'Content-Type' => 'application/json' } end - + # @return [Hash] def json_parse(json) JSON.parse(json, symbolize_names: true) end