Skip to content

An acceptable response content-type could not be provided for this request (not_acceptable) ​

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

The client requested a media type in the `Accept` header that the server cannot produce.

Quick Fix & Resolution

Use Accept: application/hal+json, Accept: application/json, or Accept: text/event-stream (for streaming endpoints).

Response Payload & SDK Handling ​

json
{
  "type": "https://orion.stellarchain.io/horizon-errors/not_acceptable",
  "title": "An acceptable response content-type could not be provided for this request",
  "status": 406,
  "detail": "An acceptable response content-type could not be provided for this request."
}
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/not_acceptable') {
    console.error('[not_acceptable] HTTP 406:', 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 == 406 {
        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 ​

  • Passing an unsupported Accept header (e.g. Accept: application/xml) to an endpoint that only serves application/hal+json, application/json, or text/event-stream.

← Back to All 23 Horizon Error Codes

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