pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.7k stars 1.7k forks source link

MethodNotAllowedHttpException #4274

Closed Minc3 closed 2 years ago

Minc3 commented 2 years ago

Current Behavior

I'm testing the API examples but when I do a post request I get this.

{
    "errors": [
        {
            "code": "MethodNotAllowedHttpException",
            "status": "405",
            "detail": "The POST method is not supported for this route. Supported methods: GET, HEAD."
        }
    ]
}

Expected Behavior

well i guess for it to work.

Steps to Reproduce

Just run a curl using the example.

curl "http://example.com/api/client/servers/0f8b3199/resources" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer APIKEYHERE' \
  -X POST \
  -b 'pterodactyl_session'='eyJpdiI6InhIVXp5ZE43WlMxUU1NQ1pyNWRFa1E9PSIsInZhbHVlIjoiQTNpcE9JV3FlcmZ6Ym9vS0dBTmx>
  -d '{
  "signal": "stop"
}'

Panel Version

1.9.2

Wings Version

1.6.4

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

No response

Is there an existing issue for this?

TrixterTheTux commented 2 years ago

The /resources endpoint doesn't accept a signal, you're most likely looking for the /power endpoint instead.