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 

参考文献

posted @   拾光师  阅读(22)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
历史上的今天:
2023-09-14 linux 查看可支持的shell
点击右上角即可分享
微信分享提示