Giter VIP home page Giter VIP logo

Comments (8)

GuoLiangjun123 avatar GuoLiangjun123 commented on June 9, 2024

我看了一下在EasyConfig中有一个addHeader的方法,但是我想在api类里面进行addHeader,现在的问题是我如何在api类里面获取到EasyConfig对象从而进行addHeader

from easyhttp.

getActivity avatar getActivity commented on June 9, 2024

小伙子,你确定这个问题文档上面没有写?

from easyhttp.

GuoLiangjun123 avatar GuoLiangjun123 commented on June 9, 2024

小伙子,你确定这个问题文档上面没有写?

EasyConfig.getInstance().addHeader("key", "value"); 这个吗哥

from easyhttp.

getActivity avatar getActivity commented on June 9, 2024

@GuoLiangjun123 不是这个,你再仔细找找

from easyhttp.

GuoLiangjun123 avatar GuoLiangjun123 commented on June 9, 2024

@GuoLiangjun123 不是这个,你再仔细找找

给字段加上 @HTTPHeader 注解即可,则表示这个字段是一个请求头,如果没有加上此注解,则框架默认将字段作为请求参数,就是这个了吧哥

from easyhttp.

getActivity avatar getActivity commented on June 9, 2024

@GuoLiangjun123 小伙子,还是找错了,你现在还是认真把文档看一遍再说。

from easyhttp.

GuoLiangjun123 avatar GuoLiangjun123 commented on June 9, 2024

@GuoLiangjun123 小伙子,还是找错了,你现在还是认真把文档看一遍再说。

IRequestInterceptor 接口来实现,是这个吗?如果是这个的话相当于返回一个全新的header,但是我们的需求是有两个全局的header和一个根据每个接口参数定义的动态header,我们现在要做的是这个动态header,所以看了整个文档下来还是觉得在文档的描述下 @HTTPHeader 注解最适合我们的需求

from easyhttp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.