medium

405 Method Not Allowed

The HTTP method (GET, POST, PUT, DELETE) is not supported for this endpoint.

Common Causes

  1. 1Using POST on a GET-only endpoint
  2. 2API doesn't support the DELETE method
  3. 3Wrong HTTP verb in the request
  4. 4CORS preflight OPTIONS request not handled

How to Fix

Handle OPTIONS for CORS preflight

// Next.js API route
export async function OPTIONS() {
  return new Response(null, {
    headers: {
      'Allow': 'GET, POST, OPTIONS',
    },
  });
}

Handle OPTIONS requests for CORS preflight.

How ObserveOne Helps

ObserveOne validates API method support and detects misconfigured endpoints.

Start Monitoring Free

Related Errors