TopggEx.HttpClient (topgg_ex v0.1.6)
View SourceHTTP client for making requests to the Top.gg API using Finch.
This module handles all HTTP communication with the Top.gg API, including request building, execution, and response parsing.
Summary
Functions
Makes an HTTP request to the Top.gg API.
Types
@type request_options() :: TopggEx.HttpClientBehaviour.request_options()
Functions
Makes an HTTP request to the Top.gg API.
Parameters
options
- Request configuration containing token, finch_name, and base_urlmethod
- HTTP method (:get, :post, etc.)path
- API endpoint pathbody
- Request body (optional)
Examples
iex> options = %{token: "token", finch_name: :topgg_finch, base_url: "https://top.gg/api"}
iex> TopggEx.HttpClient.request(options, :get, "/bots/stats")
{:ok, %{"server_count" => 100}}