//在 new StringEntity(params, "utf-8")指定為utf-8編碼 try { HttpClient client = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); //設(shè)置編碼,防止中文傳輸亂碼 StringEntity entity = new StringEntity(contentValue.toString(), "utf-8"); httpPost.setEntity(entity); HttpResponse response = client.execute(httpPost); //獲取響應(yīng)碼 status = response.getStatusLine().getStatusCode(); //status = response.getStatusLine().getStatusCode(); Log.v("jsondata", "resp = " + response.getEntity().toString()); Log.v("jsondata", "status = " + status + "\n" + contentValue.toString()); }catch(Exception e){ Log.v("jsondata", "exception"); e.printStackTrace(); }
創(chuàng)新互聯(lián)www.cdcxhl.cn,專(zhuān)業(yè)提供香港、美國(guó)云服務(wù)器,動(dòng)態(tài)BGP最優(yōu)骨干路由自動(dòng)選擇,持續(xù)穩(wěn)定高效的網(wǎng)絡(luò)助力業(yè)務(wù)部署。公司持有工信部辦法的idc、isp許可證, 機(jī)房獨(dú)有T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確進(jìn)行流量調(diào)度,確保服務(wù)器高可用性。佳節(jié)活動(dòng)現(xiàn)已開(kāi)啟,新人活動(dòng)云服務(wù)器買(mǎi)多久送多久。
創(chuàng)新互聯(lián)建站專(zhuān)注于駐馬店企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站,商城開(kāi)發(fā)。駐馬店網(wǎng)站建設(shè)公司,為駐馬店等地區(qū)提供建站服務(wù)。全流程定制網(wǎng)站開(kāi)發(fā),專(zhuān)業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)建站專(zhuān)業(yè)和態(tài)度為您提供的服務(wù)