class Pterodactyl::HttpClient

Defined in:

pterodactyl/http_client.cr

Constant Summary

HTTP_METHODS = ["get", "delete", "post", "put", "patch"] of ::String

Constructors

Instance Method Summary

Constructor Detail

def self.new(base_url : String, token : String, use_content : Bool = true) #

[View source]

Instance Method Detail

def base_url : String #

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

[View source]
def delete(path : String, body : String = "") : HTTP::Client::Response #

Performs a DELETE on the path with the given body


[View source]
def get(path : String, body : String = "") : HTTP::Client::Response #

Performs a GET on the path with the given body


[View source]
def patch(path : String, body : String = "") : HTTP::Client::Response #

Performs a PATCH on the path with the given body


[View source]
def post(path : String, body : String = "") : HTTP::Client::Response #

Performs a POST on the path with the given body


[View source]
def put(path : String, body : String = "") : HTTP::Client::Response #

Performs a PUT on the path with the given body


[View source]
def set_host(url : String) #

Sets the base url. Alias of #base_url=.


[View source]
def token : String #

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

[View source]
def uri : URI #

Returns the URI for which this client will make API requests to.


[View source]
def use_content : Bool #

[View source]
def use_content=(use_content : Bool) #

[View source]