I\'m digging myself in trying to send a POST request with a JSON payload to a remote server.
This GET curl command works fine:
curl -H \"Accept:appli
Spring's RestTemplate does not know how to serialize the Android org.json.JSONObject class. (org.json.JSONObject is not available in "normal"/desktop Java)
RestTemplate for Android supports
Jackson JSON Processor, Jackson 2.x, and Google Gson.
per: https://docs.spring.io/autorepo/docs/spring-android/1.0.1.RELEASE/reference/html/rest-template.html
With Jackson on the classpath RestTemplate should understand how to serialize Java beans.
CredentialsResource cr = new CredentialsResource();
cr.setEmail(...);
cr.setPassword(...);
HttpEntity entityCredentials = new HttpEntity(cr, httpHeaders);
P.S. It would be pretty easy to write your own JSONObjectHttpMessageConverter if you wanted to carry on using JSONObject, your converter should just have to call .toString()