Open honwhy opened 2 years ago
拦截器实现参考:https://dev.to/clavinjune/golang-http-client-interceptors-2ebe
不修改response_, _err := tea.DoRequest(request_, _runtime)调用方式, 设置全局拦截器。 类似Java的做法(Darabonba codegen的java项目有拦截器机制)
response_, _err := tea.DoRequest(request_, _runtime)
public class Client { private final static InterceptorChain interceptorChain = InterceptorChain.create(); public Client(Config config) throws Exception { ... interceptorChain.addRequestInterceptor(new RequestInterceptor() { @Override public TeaRequest modifyRequest(InterceptorContext context, AttributeMap attributes) { return null; } }); }
好的,感谢建议,我们评估下
拦截器实现参考:https://dev.to/clavinjune/golang-http-client-interceptors-2ebe
不修改
response_, _err := tea.DoRequest(request_, _runtime)
调用方式, 设置全局拦截器。 类似Java的做法(Darabonba codegen的java项目有拦截器机制)