httpURLConnection.setDoInput(true);
httpURLConnection.setDoOutput(true);
httpURLConnection.setConnectTimeout(10000);
httpURLConnection.setRequestProperty("content-type", "text/html;charset=utf-8");
httpURLConnection.setRequestMethod("POST");
其中setRequestProperty("content-type", "text/html;charset=utf-8"); 這個(gè)屬性一點(diǎn)要設(shè)置,否則接收不到數(shù)據(jù)
在接收的時(shí)候也發(fā)現(xiàn)個(gè)奇怪的問題,接收不到任何的數(shù)據(jù),后來發(fā)現(xiàn)我在
getInputStream方法前面使用了 getParameter方法,導(dǎo)致了getInputStream方法取不到任何數(shù)據(jù),只要
把他們換下位置就可以了