Andrew Fletcher published: 28 April 2017 (updated) 12 November 2020 1 minute read
If you are like me you probably have searched for clues to and found little... particularly when confronted by the errors as you unravel how this works. Okay a slight exaggeration, there are snipets of info that people have solved this annoying issue in making comments work in Drupal 8 REST services.
The lack of collective information in resolving issues has meant hours of debugging and working through core code to understand what is actually happening. If you want to read more on how we got the comments working in REST - goto Drupal 8 REST POST comments.
415 Unsupported Media Type
Then most likely reason for this error is the Content-Type is set to application/json rather than Content-Type being set to application/hal+json
Change: Content-Type: application/hal+json
Related articles
Andrew Fletcher
•
19 Apr 2024
Extending a Contrib Module's Configuration in Drupal 10: A Case Study with Sitewide Alert
Extending the functionality of a contrib module in Drupal can enhance its usefulness without altering the original codebase. This article provides a step-by-step guide on how to add custom configuration options to an existing contrib module, using the sitewide_alert module as an example. We will...
Andrew Fletcher
•
18 Apr 2024
LogicException: Form errors cannot be set after form validation has finished
When receiving a logic error such asLogicException: Form errors cannot be set after form validation has finished. in Drupal\Core\Form\FormState->setErrorByName() (line 1104 of /var/www/html/project/core/lib/Drupal/Core/Form/FormState.php).This error "LogicException: Form errors cannot be set...
Andrew Fletcher
•
09 Apr 2024
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException
Adding a new service to a custom module and the following error greeted me:The website encountered an unexpected error. Try again later.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "summaries.reference_node". in...