Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Drupal - Unsupported serialization format on REST/Delete request

In delete method you can not return ResourceResponse. Try return ModifiedResourceResponse.

return new ModifiedResourceResponse(NULL, 204);

Notice: First argument of ModifiedResourceResponse need are NULL, if your specific data for this parameter throw same error.


Also in DELETE method if you want to return a response you could use return new JsonResponse('Processed'); including the following use statement: use Symfony\Component\HttpFoundation\JsonResponse;

Tags:

8

Related

Drupal - How do I disable the taxonomy term page? Drupal - What difference between declaration of an ajax callback function with $this and without it? Drupal - Programmatically get webform submissions of a specific nodes webform Drupal - How to enable modules through configuration? Drupal - "Fields pending deletion" stopping module unistall - how to delete manually? Drupal - How do I hide a view's field based on role? Drupal - What's the difference between using $this->t('text') and t('text') in a block plugin Drupal - How to do a hard redirect when in Ajaxified form? Drupal - User Locked out after 5 failed login attempts - how to help him? Drupal - Is there any way to reuse the same file or image? Drupal - How do I programmatically update the allowed values of a list field? Drupal - How to install a module which includes a different version of Symfony?

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy