class X::Connection

Overview

Sends HTTP requests

Defined in:

x/connection.cr

Constant Summary

DEFAULT_BASE_URL = URI.parse("https://api.twitter.com/2/")
DEFAULT_CONNECT_TIMEOUT = 60.seconds
DEFAULT_HOST = "https://api.twitter.com"
DEFAULT_PORT = 443
DEFAULT_READ_TIMEOUT = 60.seconds
DEFAULT_WRITE_TIMEOUT = 60.seconds
NETWORK_ERRORS = [IO::TimeoutError]

Constructors

Instance Method Summary

Constructor Detail

def self.new(base_uri : Nil | URI = DEFAULT_BASE_URL, connect_timeout : Time::Span = DEFAULT_CONNECT_TIMEOUT, read_timeout : Time::Span = DEFAULT_READ_TIMEOUT, write_timeout : Time::Span = DEFAULT_WRITE_TIMEOUT) #

[View source]

Instance Method Detail

def base_uri : URI #

def base_uri=(base_uri : URI) #

[View source]
def base_uri? : URI | Nil #

def connect_timeout : Time::Span #

[View source]
def connect_timeout=(connect_timeout : Time::Span) #

[View source]
def http_client : HTTP::Client #

def http_client=(http_client : HTTP::Client) #

[View source]
def http_client? : HTTP::Client | Nil #

def read_timeout : Time::Span #

[View source]
def read_timeout=(read_timeout : Time::Span) #

[View source]
def send_request(request : HTTP::Request) #

[View source]
def write_timeout : Time::Span #

[View source]
def write_timeout=(write_timeout : Time::Span) #

[View source]