我想建立一个 Http 连接这是我的代码
try
{
HttpClient client = new DefaultHttpClient();
HttpPost httpMethod = new HttpPost("http://www.google.co.in/");
String requestBody = "some text";
HttpMethod.setEntity(new StringEntity(requestBody));
HttpResponse response = client.execute(httpMethod);
textView.setText(response.getStatusLine().toString());
}
但我无法并得到“HTTP/1.0 405 Method not Allowed”错误我会感谢你的帮助