我需要使用头部参数和表单参数向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