class X::RequestBuilder
- X::RequestBuilder
- Reference
- Object
Overview
Creates HTTP requests
Defined in:
x/request_builder.crConstant 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
- #build(authenticator : BearerTokenAuthenticator | OauthAuthenticator, http_method : String, url : URI, body : IO | Nil | String | Nil = nil) : HTTP::Request
- #content_type : String
- #content_type=(content_type : String)
- #user_agent : String
- #user_agent=(user_agent : String)
Constructor Detail
def self.new(content_type : String = DEFAULT_CONTENT_TYPE, user_agent : String = DEFAULT_USER_AGENT)
#
Instance Method Detail
def build(authenticator : BearerTokenAuthenticator | OauthAuthenticator, http_method : String, url : URI, body : IO | Nil | String | Nil = nil) : HTTP::Request
#