We are trying to integrate the drupal8 login REST api in react. And we are facing the below issue.

Status code 500: Service unavailable.

And When we checked the error log, we are seeing the following issue.

Symfony\Component\Serializer\Exception\NotEncodableValueException: Syntax error in Symfony\Component\Serializer\Encoder\JsonDecode->decode() (line 86 of /var/www/html/headlessdrupal/vendor/symfony/serializer/Encoder/JsonDecode.php).

Note: The below api works fine both in postman and CURL. But we having the issue, while trying to connect via react. http://domain-name/user/login?_format=json content-type: application/json username and password provided in the raw data as below: { "name": "admin", "pass": "123456" } Please help on this.

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.