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 2019/12/30 08:49:39 UTC

[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #1503: 使用restTemplate调用provider接口时如何设置请求头信息

yhs0092 commented on issue #1503: 使用restTemplate调用provider接口时如何设置请求头信息
URL: https://github.com/apache/servicecomb-java-chassis/issues/1503#issuecomment-569617251
 
 
   > 
   > 
   > 遇见过这个问题 好像是这个版本的CSE对这参数类型有强校验 所以 ResponseEntity response = restTemplate.exchange(url, HttpMethod.POST, requestEntity, Object.class) 我用object去接返回值,然后再转化成想要的类型
   
   强类型版本的Java-Chassis(1.x版本)会对RestTemplate的返回值类型有严格校验。要求返回值类型的包名和类名跟provider端服务契约声明的返回值类型完全一致(类型信息记录在契约的`x-java-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


With regards,
Apache Git Services