我想打一個HTTTP連接這裏是我的代碼錯誤HTTP/1.0 405不允許的方法
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不允許的方法」錯誤 我會謝謝你的幫助
是的,使用`HttpGet`類並使用`setParams`方法。 – raidfive 2011-02-05 03:20:47