0

I am trying to access. All required modules are included, rights granted. so does not work. /user/register?_format=hal_json

I get a message:

{"message":"Not acceptable format: hal_json"}

In RestUi settings, hal_json format is enabled.

And in the log:

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

Drupal 9.0 and Drupal 8.8.4

2 Answers 2

1

please add at header:

 Content-Type : application/hal+json
0

Did you check, maybe JSON data from the frontend doesn't cover inside of JSON.stringify(...) and you try to send regular data which not serialized for sending?

I advice to make sure you stringify data before sending:

const data = {"some":"value"} JSON.stringify(data)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.