美文网首页
Spring Cloud全解析:服务调用之Feign的编解码器

Spring Cloud全解析:服务调用之Feign的编解码器

作者: 墨线宝 | 来源:发表于2024-09-13 10:08 被阅读0次

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 

参考文献

相关文章

网友评论

      本文标题:Spring Cloud全解析:服务调用之Feign的编解码器

      本文链接:https://www.haomeiwen.com/subject/aklvljtx.html