New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support sending multiple headers or query parameters to Feign client without knowing names #1360
Comments
Please try to avoid posting the same question in multiple places. Does my answer to your question on SO help? |
Those are different things. On SO, I'm looking for an answer. Here, I'm looking for a code change. Besides, I did mention it in my post. Anyway, your answer in SO didn't help. I've updated my original post to include the code that shows this problem. |
Feign will never be as flexible as Looks like we don't support this. Looks like
|
@spencergibb Currently the |
Any other features would need a separate issue. |
|
Sorry about that forgot we are using spring mvc annotations |
Created #1361 |
@asarkar @spencergibb I am trying to use the Multi header feature It gives me the error: RequestHeader.value() was empty on parameter 0, while starting the spring boot App and feign client is never being created. Any suggestions? |
@mydata, suggestion is that you create a new ticket or SO question instead of piggybacking on a ticket closed more than a year ago. |
@mydata how did you solve the issue?? I am facing the same empty on parameter issue when using RequestHeader and passing map. Help!!! |
We've a use case where the request may contain any number of headers starting with a predefined prefix. These headers should then be sent with the Feign client request.
For example, assume that the prefix is
X-MyCompany
. The request may contain 2 headersX-MyCompany-A
andX-MyCompany-B
. We need to pass both to the Feign client.Since Feign requires all headers to be explicitly specified, this is currently not possible. It'd be nice to be able to just send a
? extends Map<String, ? extends List<String>>
to Feign and have it add all the entries to the request. The same can be done for query parameters, where the type would be? extends Map<String, String>
. Being able to send aHttpEntity
is also acceptable.Using
RestTemplate
, this is almost trivial to do. If Feign has to compete withRestTemplate
, it has to be smarter than it currently is.P.S. Posted a similar SO question.
Edit 9/23/16:
One attempt using
@HeaderMap
based on @ryanjbaxter suggestion:The text was updated successfully, but these errors were encountered: