Hi, I need your help please ever time I send data to my mysql database the posted data is empty...I don't know what is wrong with my code.
[HIGH]urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("POST");
urlConnection.setDoOutput(true);
urlConnection.setChunkedStreamingMode(0);
OutputStream out = new BufferedOutputStream(urlConnection.getOutputStream());
nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("username",adduser.getText().toString()));
nameValuePairs.add(new BasicNameValuePair("password",addpass.getText().toString()));
out.write(nameValuePairs.toString().getBytes());[/HIGH]
[HIGH]urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("POST");
urlConnection.setDoOutput(true);
urlConnection.setChunkedStreamingMode(0);
OutputStream out = new BufferedOutputStream(urlConnection.getOutputStream());
nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("username",adduser.getText().toString()));
nameValuePairs.add(new BasicNameValuePair("password",addpass.getText().toString()));
out.write(nameValuePairs.toString().getBytes());[/HIGH]