We're Hiring!

Mattermost, Inc.

Triggering slash command using API

I am developing a plugin that will utilize a slash command, and have some front end components that I want to allow to call that slash command. However, whenever I send a request to the API as shown here, I am given the response containing:

    body: (...)
    bodyUsed: false
    headers: Headers {}
    ok: false
    redirected: false
    status: 405
    statusText: "Method Not Allowed"
    type: "basic"
    url: "http://localhost:8065/commands/execute"

I’m wondering why it is responding with a 405 status, and what I might do to fix it so that I can trigger the slash command that I have working.