Issue
- When creating web content using POST, PUT, or PATCH API requests, an Error 406 is returned if no locales match the accepted languages:
{ "status": "NOT_ACCEPTABLE", "title": "No locales match the accepted languages: xx-XX" }
Environment
- Liferay DXP 7.4+
Resolution
-
This behavior for POST, PUT, and PATCH is expected when the Accept-Language header does not match any of the languages configured in Liferay.
To resolve this issue, you can either:
-
Add the desired language to the 'Current' configuration.
-
Set the Accept-Language header to one of the languages already configured:
-H "Accept-Language: xx-XX"
-
Additional Information