Spring 为什么不像RestTemplate中的postForEntity那样没有patchForEntity方法?

Spring 为什么不像RestTemplate中的postForEntity那样没有patchForEntity方法?,spring,rest,spring-boot,controller,resttemplate,Spring,Rest,Spring Boot,Controller,Resttemplate,我想知道为什么在restemplate类中没有提供与postForEntity和getForEntity相同的patchForEntity方法。只有patchForObject方法,它只返回对象,而不返回ResponseEntity 要获得补丁请求的响应,我们必须使用restemplate的交换方法,这是可以的,但我真的很好奇为什么Spring的家伙没有提供一个方便的补丁实体方法 有什么线索吗?一个类似的问题已经在中国公开。引用上面给出的答案: 。。。虽然在技术上可以引入一个patchForEn

我想知道为什么在
restemplate
类中没有提供与
postForEntity
getForEntity
相同的
patchForEntity
方法。只有
patchForObject
方法,它只返回对象,而不返回
ResponseEntity

要获得
补丁
请求的
响应
,我们必须使用
restemplate
交换
方法,这是可以的,但我真的很好奇为什么Spring的家伙没有提供一个方便的
补丁实体
方法


有什么线索吗?

一个类似的问题已经在中国公开。引用上面给出的答案:

。。。虽然在技术上可以引入一个
patchForEntity()
方法,类似于现有的
getForEntity()
postforeEntity()
方法,但没有计划在
RestTemplate
API中引入新功能

因此,为了回答您的问题,似乎没有技术上的理由不提供此功能,只是这样做的优先级不够高,因为正如您在问题中提到的,您可以使用
exchange
方法实现您想要的效果。无论如何(这对我来说是新闻),“没有计划在RestTemplateAPI中引入新功能”,因为它将被弃用,取而代之的是
WebClient
,所以
RestTemplate
可能永远不会有
patchForEntity()
方法