MastodonClient (mastodon_client v0.1.0) View Source
HTTP client for Mastodon and Pleroma based on Tesla
.
All HTTP functions take a MastodonClient.Conn.t/0
struct
and return a Tesla.Env.result/0
.
%MastodonClient{
instance: "https://gleasonator.com",
access_token: "OkgdLaYHU8A6Dc70eW7gSfBQzPFpwWI6UfHg2F2zQdM"
}
|> MastodonClient.get("/api/v1/instance")
Link to this section Summary
Link to this section Functions
Specs
new(MastodonClient.Conn.t()) :: Tesla.Client.t()
Build a Tesla client for use with Tesla HTTP functions.
You usually shouldn't need to call this function directly.
Prefer to use get/3
, post/4
, etc.
conn = %MastodonClient.Conn{instance: "https://gleasonator.com"}
client = MastodonClient.new(conn)
Tesla.get(client, "/api/v1/instance")