我有三个问题!
第一.
我使用spring框架通过rest协议发送数据.
restTemplate.exchange(requestUrl,HttpMethod.POST, request, listVo.getClass());
org.springframework.web.client.RestTemplate.exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<? extends Object> responseType, Object... uriVariables) throws RestClientException
Run Code Online (Sandbox Code Playgroud)
我没有任何问题地使用它,但我想知道参数responseType的用途.客户端不使用响应数据,而只使用响应状态代码/ msg.所以,我发送了一些毫无意义的String数据.但是他们接受"null"的错误被抛出.所以我发送了一个"null"字符串.不是空的.然后,错误摆脱了.但还有另一个问题.客户端从服务器收到数据并暂停了很长时间后.然后执行下一行代码.有什么问题?
第二
我找不到任何使用Spring RestTemplate的execute方法的引用.
第三
与标题一样,spring rest模板中的exchange方法和execute方法有什么区别?
感谢您的时间和精力.干杯.
| 归档时间: |
|
| 查看次数: |
8512 次 |
| 最近记录: |