我需要使用頭部參數和表單參數向REST Web服務發出POST請求。我有網絡服務方法的描述:REST Web服務POST方法頭和表單參數
Method: POST/
Produces: application/json/
Consume: application/x-www-form-urlencoded/and etc.
和我需要發送的標題和表單參數列表。
任何人都可以澄清什麼是生產和消費以及如何形成請求?
As I undestand: httpPost = new HttpPost(webServiceUrl + methodName);
httpPost.setHeader("headerParamName", headerParam);
entity = jsonObject.put(param.getKey(), param.getValue());//param - form param
httpPost.setEntity(entity);
httpPost.setHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF8"); //???
對不起,如果問題是假的。
我應該添加一些額外的信息? – user1074896 2012-01-04 09:25:55