我想做一个Htttp连接这是我的代码
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()); }
解决方法
这意味着请求的URL不接受POST方法.再试一次GET.