Module: Azure::Storage::Common::Core::HttpClient

Included in:
Azure::Storage::Common::Client
Defined in:
lib/azure/storage/common/core/http_client.rb

Instance Method Summary collapse

Instance Method Details

#agents(uri) ⇒ Net::HTTP

Returns the http agent based on uri

Parameters:

  • uri (URI|String)

    the base uri (scheme, host, port) of the http endpoint

Returns:

  • (Net::HTTP)

    http agent for a given uri



32
33
34
35
36
37
38
39
# File 'lib/azure/storage/common/core/http_client.rb', line 32

def agents(uri)
  key = uri.to_s
  @agents ||= {}
  unless @agents.key?(key)
    @agents[key] = build_http(uri)
  end
  @agents[key]
end

#reset_agents!Object

Empties all the http agents



42
43
44
# File 'lib/azure/storage/common/core/http_client.rb', line 42

def reset_agents!
  @agents = nil
end