I wanted to know if there were any ways to have a POST call on my Play framework REST API without any JSON in the call.
I'm making the API with the logic that if you create anything in the database, then you need to make a POST call, but yet I have this issue that occurs right when it hits the API :
For request 'POST /promotions/add/user?userId=41375&promoId=24265'
[Invalid Json: No content to map due to end-of-input at [Source: akka.util.ByteIterator$ByteArrayIterator$$anon$1@a5de52b; line: 1, column: 0]]
Please check if you have set any content-type in the request. Also check how the requests are handled within the action method like using
If your POST request is not using the json as the data payload, you may use a form to be bound from the request. In that case, make sure that you have set the
Content-Type: application/x-www-form-urlencoded in the request. Sometimes, it doesn't matter you set proper content type header in request. It all depends on how POST request is handled by the controller action methods/API endpoints.