Spring Cloud全解析:服务调用之Feign的编解码器
Feign的编解码器
编码器
在向服务发送请求时,有些情况需要对请求内容进行处理
public class FeignSpringFormEncoder implements Encoder {
@Override
public void encode(Object object, Type bodyType, RequestTemplate template) throws EncodeException
解码器
可以对服务响应的内容进行处理
public class FeignDecoder implements Decoder {
@Override
public Object decode(Response response, Type type) throws IOException, DecodeException, FeignException
参考文献
本文来自博客园,作者:拾光师,转载请注明原文链接:https://www.cnblogs.com/life-time/p/18413408 个人博客-> https://zhhll.icu

浙公网安备 33010602011771号