# File lib/apipie_bindings/api.rb, line 168
    def http_call(http_method, path, params={}, headers={}, options={})
      headers ||= { }

      args = [http_method]
      if %w[post put].include?(http_method.to_s)
        #If using multi-part forms, the paramaters should not be json
        if ((headers.include?(:content_type)) and (headers[:content_type] == "multipart/form-data"))
          args << params
        else
          args << params.to_json
        end
      else
        headers[:params] = params if params
      end

      log.info "#{http_method.to_s.upcase} #{path}"
      log.debug "Params: #{params.ai}"
      log.debug "Headers: #{headers.ai}"

      args << headers if headers

      if dry_run?
        empty_response = ApipieBindings::Example.new('', '', '', 200, '')
        ex = options[:fake_response ] || empty_response
        response = RestClient::Response.create(ex.response, ex.status, args)
      else
        begin
          response = @client[path].send(*args)
          update_cache(response.headers[:apipie_checksum])
        rescue => e
          log.error e.message + "\n" +
            (e.respond_to?(:response) ? process_data(e.response).ai : e.ai)
          raise
        end
      end

      result = options[:response] == :raw ? response : process_data(response)
      log.debug "Response %s" % (options[:reduce_response_log] ? "Received OK" : result.ai)
      result
    end