Rest: Error when format is not JSON

Created on 3 April 2019, over 5 years ago
Updated 28 June 2024, 2 months ago

I have Drupal 8.6.13 with modules "RESTful Web Services" and "Serialization" enabled.

When i open a link with a wrong format (not JSON), website logs a crash:

example "abc": https://www.test.be/node/1?_format=abc

The website encountered an unexpected error. Please try again later.

Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException: Not acceptable format: abc in Drupal\Core\EventSubscriber\RenderArrayNonHtmlSubscriber->onRespond() (line 30 of /data/sites/web/jan/www/quiz/core/lib/Drupal/Core/EventSubscriber/RenderArrayNonHtmlSubscriber.php).

🐛 Bug report
Status

Closed: duplicate

Version

8.6 ⚰️

Component
REST 

Last updated 6 days ago

Created by

🇧🇪Belgium djan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024