You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/04/20 06:44:49 UTC
[GitHub] [servicecomb-java-chassis] xhanthow edited a comment on issue #1722: 反序列化失败问题
xhanthow edited a comment on issue #1722:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1722#issuecomment-616344240
补充:
如图,`value`类型为`String`,这样就会报错。

但是我传`JSONObject`就ok

用的是
```
RestTemplate restTemplate = RestTemplateBuilder.create();
String body = "{\"courseIds\":[\"311497735721202688\"],\"nextAction\":1,\"removalReason\":\"222\"}";
// 成功
HttpEntity entity = new HttpEntity(JSONObject.parseObject(body), httpHeaders);
// 失败
// HttpEntity entity = new HttpEntity(body, httpHeaders);
ResponseEntity<Object> response = restTemplate.exchange(url, HttpMethod.POST, entity, Object.class);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org