我的授權標頭爲「授權:TRUEREST username = user & password = pass & apikey = key & class = class」。如何把它放入HTTPPOST請求..? 我這樣做:向Android中的HTTP POST請求添加授權標頭(使用JSON)
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
httppost.setHeader("Authorization","TRUEREST");
httppost.setHeader("username","user");
httppost.setHeader("password","pass");
httppost.setHeader("apikey","key");
httppost.setHeader("class","class");
憑證不發送。這段代碼有什麼錯? 請幫助.. !! 在此先感謝。
httpResponse.getStatusLine()。getStatusCode();的值是什麼? – yorkw 2012-04-23 21:11:58
帖子的想法是通過身體的數據,而不是在標題 – sivi 2015-12-03 18:35:35