バックエンドに Drupal8 を使用して Angular2 Web アプリを作成しています。API エンドポイント「/taxonomy/term/{taxonomy_term}」を使用するために、分類 ID をそれぞれのラベルに変換する必要があります。正しい REST-API を有効にしてすべてのロールへのアクセスを許可しましたが、ID と ?_format=json を使用してそのエンドポイントにアクセスしようとすると、「{"メッセージ":"受け入れられない形式: json」というメッセージが表示されます。 "}'. ただし、?format=json を削除すると、HTML で必要な結果が得られます。
このエラー メッセージはファイル /core/lib/Drupal/Core/EventSubscriber/AcceptNegotiation406.php にあり、前に次のコメントがあります。
// If this is a render array then we assume that the router went with the
// generic controller and not one with a format. If the format requested is
// not HTML though we can also assume that the requested format is invalid
// so we provide a 406 response.
誰でもこれで私を助けることができますか?または、HTML 結果から分類ラベルをスクレイピングする必要があります。