Giter Club home page Giter Club logo

Comments (7)

davidmc24 avatar davidmc24 commented on May 30, 2024

Hmm... nothing that I'm aware of for dynamic header values based on method arguments.

A request interceptor can have dynamic behavior, including adding request headers, based on anything else in the request template. Probably the closest to what you're looking for in the existing functionality would be adding query parameters based on method arguments, and a request interceptor to move the values from query parameters to headers. It's a rather indirect approach, however. Instead, I think it would make sense to enhance Feign by adding support for tokenization of header annotations.

from feign.

codefromthecrypt avatar codefromthecrypt commented on May 30, 2024

I think headers already supports token replacement via Named parameters, right?

https://github.com/Netflix/feign/blob/master/core/src/main/java/feign/Headers.java

from feign.

davidmc24 avatar davidmc24 commented on May 30, 2024

Don't know how I missed that. Ignore what I said earlier. Using token replacement in declared header annotations is the right approach, and should already be supported.

from feign.

earthconfed avatar earthconfed commented on May 30, 2024

I am creating a Feign client with Ribbon Module, how do I attach a interceptor in the Feign.create function?

Or how do I attach the RibbonModule with the builder method?

from feign.

davidmc24 avatar davidmc24 commented on May 30, 2024

The readme covers how to use the RibbonModule with Feign.create.

https://github.com/Netflix/feign#ribbon

To attach an interceptor when using Feign.create, you will need to create a custom Dagger module.

https://github.com/Netflix/feign#dagger
http://square.github.io/dagger/

from feign.

codefromthecrypt avatar codefromthecrypt commented on May 30, 2024

here's an example of a header param in use.

https://github.com/Netflix/denominator/blob/master/dynect/src/main/java/denominator/dynect/InvalidatableTokenProvider.java

wrt ribbon, it could be refactored to expose RibbonClient, which could be passed as a builder arg. for now, what @davidmc24 says is correct.

from feign.

codefromthecrypt avatar codefromthecrypt commented on May 30, 2024

ping if this didn't help!

from feign.

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.