glyph/network/rest

This handles the logic for communicating with the Discord REST API. For more information: https://discord.com/developers/docs/reference#http-api

Types

Acceptable values for an Authorization header

pub type TokenType {
  Bearer
  Bot
}

Constructors

  • Bearer
  • Bot

Constants

pub const api_version: String = "10"

Functions

pub fn get(
  r: Request(String),
  endpoint: String,
) -> Result(Response(String), Error)
pub fn new() -> Request(String)
pub fn post(
  r: Request(String),
  endpoint: String,
  body: String,
) -> Result(Response(String), Error)
pub fn set_authorization(
  r: Request(String),
  token_type: TokenType,
  token: String,
) -> Request(String)
pub fn set_bot_user_agent(
  r: Request(a),
  url: String,
  version: String,
) -> Request(a)
pub fn set_content_type(
  r: Request(String),
  content_type: String,
) -> Request(String)
Search Document