android開發中碰見405NotAllowednginx/0.7.67錯誤: html
錯誤緣由:使用post方式請求靜態頁面 android
部分代碼以下: ide
Stringurl="http://m.weather.com.cn/data/101010100.html";
//HttpPostrequest=newHttpPost(url);//post方式請求出錯,如圖一post
HttpGetrequest=newHttpGet(url);//正常,如圖二
HttpResponsehttpResponse;
StringretSrc=null;
try{
httpResponse=newDefaultHttpClient().execute(request);
retSrc=EntityUtils.toString(httpResponse.getEntity());
JSONObjectresult=newJSONObject(retSrc);
returnparseInfo(result);
}catch(Exceptione){
return"出錯了<br/>"+e.getMessage()+"<br/>"+retSrc;
} url