Skip to content

Method Not Allowed (method_not_allowed) ​

HTTP 405Horizon RFC 7807 ProblemCode: method_not_allowed
Type URI: https://orion.stellarchain.io/horizon-errors/method_not_allowed

The HTTP method used is not supported for this endpoint.

Quick Fix & Resolution

Check the Allow response header and use GET for queries or POST for /transactions, /transactions_async, and /rpc.

Response Payload & SDK Handling ​

json
{
  "type": "https://orion.stellarchain.io/horizon-errors/method_not_allowed",
  "title": "Method Not Allowed",
  "status": 405,
  "detail": "The HTTP method is not allowed for this resource."
}
typescript
import { Horizon } from '@stellar/stellar-sdk';

const server = new Horizon.Server('https://pubnet.stellarchain.io');

try {
  const res = await server.ledgers().limit(10).call();
} catch (err: any) {
  const problem = err?.response?.data;
  if (problem?.type === 'https://orion.stellarchain.io/horizon-errors/method_not_allowed') {
    console.error('[method_not_allowed] HTTP 405:', problem.detail, problem.extras);
  }
}
go
client := &horizonclient.Client{
    HorizonURL: "https://pubnet.stellarchain.io",
}
_, err := client.Root()
if hErr := horizonclient.GetError(err); hErr != nil {
    if hErr.Problem.Status == 405 {
        log.Printf("Problem (%s): %s - extras=%v", hErr.Problem.Type, hErr.Problem.Detail, hErr.Problem.Extras)
    }
}
bash
curl -i -s "https://pubnet.stellarchain.io/" \
  -H "Accept: application/hal+json"

Common Root Causes ​

  • Sending a POST, PUT, or DELETE request to a read-only GET endpoint.
  • Sending a GET request to POST /transactions or POST /rpc.

← Back to All 23 Horizon Error Codes

Open-Source Stellar Horizon & Orion Documentation under MIT License.