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
•
09 May 2024
Accessing nested paragraph fields in Drupal: a step-by-step reference
The issue – I have a content type that includes an entity reference revisions field named field_introduction. This field points to a paragraph, which itself contains a text field also named field_introduction, of the type Text (formatted, long). How can I access the content stored in this...
Andrew Fletcher
•
09 May 2024
How to retrieve the current menu title in Drupal – a developer’s reference
When building a theme in Drupal, it's often necessary to adapt your site’s UI dynamically based on the context in which a user is navigating. One such piece of dynamic content is the menu title. Achieving this can be a bit tricky due to the layered nature of its routing and menu systems. This...
Andrew Fletcher
•
07 May 2024
Understanding and resolving a Drupal render array error
Dealing with errors in Drupal development is a common occurrence, and understanding how to interpret and resolve them is essential for smooth development workflows. In this article, we'll delve into a specific error message related to render arrays in Drupal and discuss steps to diagnose and fix the...