NAME

Twilio::Domain - Base class for a Twilio API host

SYNOPSIS

package Twilio::Rest::Api;
use parent 'Twilio::Domain';

sub new {
  my ($class, $client) = @_;
  my $self = $class->SUPER::new($client);
  $self->{base_url} = 'https://api.twilio.com';
  return $self;
}

DESCRIPTION

A domain is one Twilio product host, such as api.twilio.com. Subclasses set base_url in their constructor. Applications reach domains through Twilio::Rest::Client and do not use this class directly.

METHODS

new

my $domain = Twilio::Domain->new($client);

absolute_url

my $url = $domain->absolute_url('/2010-04-01/Accounts.json');

Returns the URL for a path on this host.

request

my $response = $domain->request($method, $uri, \%options);

Sends a request for a path on this host through the client. The options are those of "request" in Twilio::Http::Client.

get_client

Returns the client.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.