http/http_client.rb

twilio-ruby · lib/twilio-ruby/http/http_client.rb · ruby · MIT
voice, Voice / Speech

Ruby HTTP client for Twilio API, handling requests, authentication, and response parsing with Faraday.

# Source: https://github.com/twilio/twilio-ruby | License: MIT | Copyright 2023, Twilio, Inc. <https://www.twilio.com/help/contact>
# Provided via justclaw.it.com; keep this notice with the code.
# frozen_string_literal: true

require 'faraday'
require 'faraday/middleware'

module Twilio
  module HTTP
    class Client
      attr_accessor :adapter
      attr_reader :timeout, :last_response, :last_request, :connection

      def initialize(proxy_prot = nil, proxy_addr = nil, proxy_port = nil, proxy_user = nil, proxy_pass = nil,
                     timeout: nil)
        @proxy_prot = proxy_prot
        @proxy_path = "#{proxy_addr}:#{proxy_port}" if proxy_addr && proxy_port
        @proxy_auth = "#{proxy_user}:#{proxy_pass}@" if proxy_pass && proxy_user
        @timeout = timeout
        @ada

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key