I’m trying to send a URL with some parameters using HttpPost but it has no success. I’m using this code:
public void Exchange()
{
final ProgressDialog pd = ProgressDialog.show(this, null, ResourceBundle.getBundle("lang").getString("doTheAction"), true, false);
new Thread(){
public void run() {
HttpClient httpclient = new DefaultHttpClient();
try {
httpclient.execute(new HttpPost(URL));
Merchant.this.runOnUiThread(new Runnable(){
@Override
public void run(){
Again();
}
});
} catch (IOException e) { e.printStackTrace(); }
finally { httpclient.getConnectionManager().shutdown(); }
pd.dismiss();
}
}.start();
}
It doesn’t do anything but it has to change some values on a MySQL database. Can someone help me? It seems that is all correct.
Thank you in advance!
You can use this function to post data to server via API, then changing some values on a MySQL database is server-side tasks