Comments (7)
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.
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.
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.
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.
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.
here's an example of a header param in use.
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.
ping if this didn't help!
from feign.
Related Issues (20)
- Error in RequestTemplate#uri when there're both query and fragment
- Error in Expressions.PathStyleExpression#getValue
- @GetMapping Required String parameter is not present HOT 3
- JacksonJrDecoder is not able to deserialize generics
- feign.jackson.jr.JacksonJrDecoder#findTransformer is not extendable
- [Feature Request] Support custom tags for Dropwizard metrics
- Unexpected FeignException instead of ResponseEntity when the server returns 401 HOT 1
- Response.protocolVersoin may be null causing NPEs
- feign-micrometer: spanId/parentId information lost HOT 2
- Breaking change with Alpha version of OkHttp3 Library HOT 2
- Headers annotation not sending headers HOT 2
- Feign changes capitalization of header-keys HOT 1
- feign-micrometer: No client tag on MicrometerObservation meters
- Add documentation/exception for required java compiler flag "parameters"
- Even using OptionalDecoder I get an exception on 404 HOT 1
- Builder breaks resilience4j 1.7.x (latest java <17 compatible release) HOT 3
- Call Timeout(OKHTTP) not working for my Open Feign Config. HOT 17
- @PatchMapping and @DeleteMapping insert unwanted slash when using url and specific value HOT 3
- The current code can only get the thread pool of its own httpclient. How to get the thread pool used in feign.httpclient.ApacheHttpClient instead? HOT 1
- Final fields of payload object are not recognized when executing POST form-urlencoded HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feign.