这就是我发布的方式...不需要身份验证
DefaultHttpClient hc=new DefaultHttpClient();
ResponseHandler <String> res=new BasicResponseHandler();
HttpPost postMethod=new HttpPost("http://mydomain.com/myfile.php";
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
//These are the values you are posting
nameValuePairs.add(new BasicNameValuePair("name", username.getText().toString() ));
nameValuePairs.add(new BasicNameValuePair("username", username.getText().toString() ));
nameValuePairs.add(new BasicNameValuePair("email", email.getText().toString() ));
nameValuePairs.add(new BasicNameValuePair("password", password.getText().toString() ));
postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));
String response=hc.execute(postMethod,res);