HTTP Form Submission Method - nxtele/nxcloud-doc-en GitHub Wiki
Most 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/x-www-form-urlencoded
header:
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
- Please make sure to correctly urlencode the submitted fields:
String body = "phone=8411111111&content=" + URLEncoder.encode("Your SMS content, Your short link content", "UTF-8") + "&.....";
Here is an example screenshot of a submission using Postman: