标签: rest
拥有标题的目的是什么? 为什么必须在请求正文中添加标题?
示例代码:
HttpPost methodPut = new HttpPost(url); HttpClient httpclient = HttpClients.createDefault(); methodPut.setHeader("Content-Type", "application/json");
答案 0 :(得分:0)
因为可以有多个"内容类型"。