FoxoChat.js Packages
    Preparing search index...

    Module @foxochat/rest

    FoxoChat REST

    The HTTP REST API client for foxochat.js

    Install with npm / yarn / pnpm:

    npm install @foxochat/rest
    yarn add @foxochat/rest
    pnpm add @foxochat/rest
    import REST from "@foxochat/rest";
    import { APIRoutes, RouteUrlsMap } from "@foxochat/api-types";

    const rest = new REST({
    baseURL: RouteUrlsMap.production.api,
    });

    rest.token = TOKEN;

    try {
    await rest.post(APIRoutes.messages(CHANNEL_ID), {
    body: {
    content: "floof by coof",
    },
    });
    } catch (error) {
    console.error(error);
    }

    Enumerations

    RequestBodyType
    RequestMethod

    Classes

    APIError
    AuthEnforcedError
    HTTPError
    REST

    Interfaces

    InternalRequestOptions
    Options
    RequestHeaders
    RequestOptions
    ResponseLike

    Type Aliases

    ConstructorOptions
    RequestBody
    RouteLike

    Variables

    DefaultOptions

    Functions

    buildURLSearchParams
    parseResponse
    serializeURLSearchParam

    References

    default → REST