如何在伪装中添加http标头?

时间:2019-06-28 08:54:53

标签: spring-cloud

我正在使用feign(10.0.1)调用微服务,这是我的客户代码:

public class EnvelopOperate {

    @Autowired
    private IRedEnvelopeController envelopeController;

    public void sendEnvelop(Long userId, Long playRoomId, Integer triggerNum) {
        SendRedEnvelopeRequest sendRedEnvelopeRequest = new SendRedEnvelopeRequest();
        sendRedEnvelopeRequest.setTriggerNum(triggerNum);
        Response<SendRedEnvelopeResponse> sendResponse = envelopeController.sendRedEnvelope(sendRedEnvelopeRequest);
    }
}

问题是:如何在客户端代码中将auth令牌标头添加到伪装中?

这是另一边的代码:

@PostMapping({"/send"})
Response<SendRedEnvelopeResponse> sendRedEnvelope(SendRedEnvelopeRequest var1);

0 个答案:

没有答案