需要帮助使用HTTPpost将数据发送到服务器

I'm trying to create user accounts for my applicatin and i'm working on the register process i have the following code in an AsynTask extended class:

        HttpClient client = new DefaultHttpClient(httpRequestParams);

        HttpPost post = new HttpPost(SERVER_ADDRESS + "Register.php");

        ArrayList<NameValuePair> dataToSend = new ArrayList<>();
        dataToSend.add(new BasicNameValuePair("name",user.name));
        dataToSend.add(new BasicNameValuePair("username", user.username));
        dataToSend.add(new BasicNameValuePair("password", user.password));


        try {
            post.setEntity(new UrlEncodedFormEntity(dataToSend));

        }catch (UnsupportedEncodingException e){
            e.printStackTrace();
        }
        try {

            HttpResponse httpResponse = client.execute(post);
            Log.d("ServerRequests", "client is executing");
            Log.d("Http Post Response:",httpResponse.toString());

        }catch (ProtocolException e){
            e.printStackTrace();
        }catch (IOException e){
            e.printStackTrace();
        }

useing the log Tag above in the code i figured out that everything in the code is executed except for the line: HttpResponse httpResponse = client.execute(post); here is my php code:

$name=$_POST["name"];
$username=$_POST["username"];
$password=$_POST["password"];
$statement=mysqli_prepare($con,"INSERT INTO users (name,username,password) VALUES (?,?,?)");
mysqli_stmt_bind_param($statement,"sss",$name,$username,$password);
mysqli_stmt_execute($statement);
mysqli_stmt_close($statement);
mysqli_close($con);

so would you please help me identify the problem here?

additional information: i'm using wamp server v2.5 and i'm granting Internet permission to my app

?>

HttpClient is deprecated in maybe SDK v20, and clear is that it is not available in SDK v23, you should use HttpURLConnection, see this link

How to add parameters to HttpURLConnection using POST