Mande
    Preparing search index...

    Interface MandeInstance

    Object returned by mande

    interface MandeInstance {
        options: Required<Pick<OptionsRaw<ResponseAsTypes>, "headers">> & Omit<
            OptionsRaw<ResponseAsTypes>,
            "headers",
        >;
        delete<T = unknown, R extends ResponseAsTypes = "json">(
            options?: Options<R>,
        ): MandeResponse<T, R>;
        delete<T = unknown, R extends ResponseAsTypes = "json">(
            url: string | number,
            options?: Options<R>,
        ): MandeResponse<T, R>;
        get<T = unknown, R extends ResponseAsTypes = "json">(
            options?: Options<R>,
        ): MandeResponse<T, R>;
        get<T = unknown, R extends ResponseAsTypes = "json">(
            url: string | number,
            options?: Options<R>,
        ): MandeResponse<T, R>;
        patch<T = unknown, R extends ResponseAsTypes = "json">(
            data?: any,
            options?: Options<R>,
        ): MandeResponse<T, R>;
        patch<T = unknown, R extends ResponseAsTypes = "json">(
            url: string | number,
            data?: any,
            options?: Options<R>,
        ): MandeResponse<T, R>;
        post<T = unknown, R extends ResponseAsTypes = "json">(
            data?: any,
            options?: Options<R>,
        ): MandeResponse<T, R>;
        post<T = unknown, R extends ResponseAsTypes = "json">(
            url: string | number,
            data?: any,
            options?: Options<R>,
        ): MandeResponse<T, R>;
        put<T = unknown, R extends ResponseAsTypes = "json">(
            data?: any,
            options?: Options<R>,
        ): MandeResponse<T, R>;
        put<T = unknown, R extends ResponseAsTypes = "json">(
            url: string | number,
            data?: any,
            options?: Options<R>,
        ): MandeResponse<T, R>;
    }
    Index

    Properties

    Methods

    Properties

    options: Required<Pick<OptionsRaw<ResponseAsTypes>, "headers">> & Omit<
        OptionsRaw<ResponseAsTypes>,
        "headers",
    >

    Writable options.

    Methods

    post

    • post<T = unknown, R extends ResponseAsTypes = "json">(
          data?: any,
          options?: Options<R>,
      ): MandeResponse<T, R>

      Sends a POST request to the base url. This is equivalent to calling post with an empty string.

      Type Parameters

      Parameters

      • Optionaldata: any

        optional body of the request

      • Optionaloptions: Options<R>

        optional Options

      Returns MandeResponse<T, R>

      const createdUser = await users.post({ name: 'Eduardo' })
      
    • post<T = unknown, R extends ResponseAsTypes = "json">(
          url: string | number,
          data?: any,
          options?: Options<R>,
      ): MandeResponse<T, R>

      Sends a POST request to the given url.

      Type Parameters

      Parameters

      • url: string | number

        relative url to send the request to

      • Optionaldata: any

        optional body of the request

      • Optionaloptions: Options<R>

        optional Options

      Returns MandeResponse<T, R>

      const createdUser = await users.post('', { name: 'Eduardo' })