I'm trying to post HTTP request to my web application. But there is no action done. Where am I wrong?
class AsyncT extends AsyncTask<Void,Void,Void> {
@Override
protected Void doInBackground(Void... params){
try{
String url1 = "http://172.26.1.1/data/omnidrive";
URL url = new URL(url1);
HttpURLConnection httpURLConnection =
(HttpURLConnection)url.openConnection();
httpURLConnection.setDoOutput(true);
httpURLConnection.setRequestMethod("POST");
httpURLConnection.connect();
String data = "[0.10,0.00,0.00]";
DataOutputStream wr = new
DataOutputStream(httpURLConnection.getOutputStream());
wr.writeBytes(data);
wr.flush();
wr.close();
} catch (MalformedURLException e){
e.printStackTrace();
} catch(IOException e){
e.printStackTrace();
}
return null;
}
}
I expected the data to be updated in the web application.
This is what it shows after I clicked the button
Error
W/Settings: Setting device_provisioned has moved from android.provider.Settings.Secure to android.provider.Settings.Global. V/HiTouch_HiTouchSensor: User setup is finished. D/NetworkSecurityConfig: No Network Security Config specified, using platform default I/ViewRootImpl: jank_removeInvalidNode all the node in jank list is out of time