def do_request(url, type, &_block)
      uri = URI.parse("#{api_url}/#{url}")
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true

      request = type.new(uri.request_uri, headers)

      yield request if block_given?

      response = http.request(request)

      parse!(response)
    end
def do_request(url, type, &_block)
      uri = URI.parse("#{api_url}/#{url}")
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true

      request = type.new(uri.request_uri, headers)

      yield request if block_given?

      response = http.request(request)

      parse!(response)
    end
generic part of requesting api