class X::RequestBuilder

Overview

Creates HTTP requests

Defined in:

x/request_builder.cr

Constant Summary

AUTHORIZATION_HEADER = "Authorization"
CONTENT_TYPE_HEADER = "Content-Type"
DEFAULT_CONTENT_TYPE = "application/json; charset=utf-8"
DEFAULT_USER_AGENT = "X-Client/#{VERSION} Crystal/#{Crystal::VERSION}"
HTTP_METHODS = ["GET", "POST", "PUT", "DELETE"]
USER_AGENT_HEADER = "User-Agent"

Constructors

Instance Method Summary

Constructor Detail

def self.new(content_type : String = DEFAULT_CONTENT_TYPE, user_agent : String = DEFAULT_USER_AGENT) #

[View source]

Instance Method Detail

def build(authenticator : BearerTokenAuthenticator | OauthAuthenticator, http_method : String, url : URI, body : IO | Nil | String | Nil = nil) : HTTP::Request #

[View source]
def content_type : String #

[View source]
def content_type=(content_type : String) #

[View source]
def user_agent : String #

[View source]
def user_agent=(user_agent : String) #

[View source]