Per*_*ion 11
这是一些伪代码.请注意,您不应在PUT请求中发送表单url编码数据,因为它可能会破坏服务器端OAuth(如果使用):
HttpClient client = new DefaultHttpClient();
HttpPut put = new HttpPut(url);
put.addHeader("Content-Type", "application/json");
put.addHeader("Accept", "application/json");
put.setEntity(new StringEntity(jsonObj.writeValue()));
HttpResponse response = client.execute(put);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6600 次 |
| 最近记录: |