In your curl
-command, you are posting form data along with the Content-Type: application/json
. Clearly this data is not valid JSON, hence the 400 bad request.
If you want to post form data, you need to use the content type application/x-www-form-urlencoded