Module: Azure::HttpClient
- Included in:
- Client
- Defined in:
- lib/azure/http_client.rb
Instance Method Summary collapse
-
#agents(uri) ⇒ Net::HTTP
Returns the http agent based on uri.
-
#management_request(method, path, options_or_body = {}) ⇒ Object
Creates a new management request for the current configuration.
-
#sql_management_request(method, path, options_or_body = {}) ⇒ Object
Creates a new management request for the current configuration.
Instance Method Details
#agents(uri) ⇒ Net::HTTP
Returns the http agent based on uri
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/azure/http_client.rb', line 51 def agents(uri) = {} uri = URI.parse(uri) if uri.is_a?(String) if uri.scheme.downcase == 'https' [:ca_file] = self.ca_file if self.ca_file [:verify] = true end = if ENV['HTTP_PROXY'] || ENV['HTTPS_PROXY'] ENV['HTTP_PROXY'] ? URI::parse(ENV['HTTP_PROXY']) : URI::parse(ENV['HTTPS_PROXY']) end || nil Faraday.new(uri, ssl: , proxy: ) do |conn| conn.use FaradayMiddleware::FollowRedirects conn.adapter Faraday.default_adapter end end |
#management_request(method, path, options_or_body = {}) ⇒ Object
Creates a new management request for the current configuration
23 24 25 26 27 28 29 30 31 |
# File 'lib/azure/http_client.rb', line 23 def management_request(method, path, = {}) ||= {} = if .is_a?(Hash) else {body: } end BaseManagement::ManagementHttpRequest.new(method, path, {client: self}.merge()) end |
#sql_management_request(method, path, options_or_body = {}) ⇒ Object
Creates a new management request for the current configuration
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/azure/http_client.rb', line 37 def sql_management_request(method, path, = {}) ||= {} = if .is_a?(Hash) else {body: } end puts [method, path, ] BaseManagement::SqlManagementHttpRequest.new(method, path, {client: self}.merge()) end |