-1

I have a drupal 9 site with PHP 8. I have one GET API. While i send the request i am getting an error like

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

Symfony\Component\Serializer\Exception\RuntimeException: No decoder found for format "form". in Symfony\Component\Serializer\Encoder\ChainDecoder->getDecoder() (line 78 of /var/www/html/onemodernizewcm/vendor/symfony/serializer/Encoder/ChainDecoder.php).

Symfony\Component\Serializer\Encoder\ChainDecoder->decode() (Line: 314) Symfony\Component\Serializer\Serializer->decode() (Line: 168) Drupal\rest\RequestHandler->deserialize() (Line: 67) Drupal\rest\RequestHandler->handle() call_user_func_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 80) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 67) Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 58) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23) Stack\StackedHttpKernel->handle() (Line: 709) Drupal\Core\DrupalKernel->handle() (Line: 19)

I am sending the request with basic authentication and with correct credentials also. Can anyone please help in resolving this issue? Is this something related to php version. Note - The serializer version is 4.4.

1
  • Are you making sure to decode the response for your API request? Like this: ``` $responseData = json_decode($apiResponse); ```
    – JCMSmith
    Aug 3 at 10:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.