我想使用www.example进行服务呼叫 www.example.com 方法:下面是我想消费的服务:
@PostMapping(value = "/service", consumes = { "application/x-www-form-urlencoded" })
public ServiceObligationResponse retrieveServiceObligationResponsesByServiceObligationRequests(
@Valid @RequestParam Map<String, String> params,
@RequestHeader(value = KEY, required = true) String key,
@RequestHeader(value = ID, required = true) String id,
@RequestHeader(value = AUTH_HEADER, required = true) String authHeader)
throws CustomUnAuthorizedException {
Some code ...............
}
请帮助我是微服务的新手
1条答案
按热度按时间cu6pst1q1#
只需将头和参数添加到
RestTemplate
对象。