HTTP JSON Submission Method - nxtele/nxcloud-doc-en GitHub Wiki
Some of the interfaces in NXcloud are submitted in this way.
- Set the HTTP method to
POST
:
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
- Add the
Content-Type: application/json
header:
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");