Skip to content
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

Feature: build method to pass request header in the RestClientBuilder #283

Closed
akoserwal opened this issue Jul 14, 2020 · 4 comments · Fixed by #378
Closed

Feature: build method to pass request header in the RestClientBuilder #283

akoserwal opened this issue Jul 14, 2020 · 4 comments · Fixed by #378
Labels
Milestone

Comments

@akoserwal
Copy link

It would be good to have a builder method to set request header in RestClientBuilder

@andymc12
Copy link
Contributor

Hi @akoserwal - thanks for opening this issue. Can you provide us with a use case? There are already a few different ways to send request headers (using @HeaderParam("someHeader") on a method parameter, using @ClientHeaderParam(name="someHeader", value="someValue") on the method or interface, or by implementing a ClientHeadersFactory interface) - perhaps one of these approaches might work for you?

@akoserwal
Copy link
Author

@andymc12: thanks for the suggestions. Here, I need to add a header:
https://github.com/Apicurio/apicurio-registry/blob/master/client/src/main/java/io/apicurio/registry/client/GenericClient.java#L193

I think it would be more convenient to have a builder method where I can provide the header. It will save from the complication of implementing a factory for this basic purpose.

@akoserwal
Copy link
Author

I have tried using @ClientHeaderParam on a sample application, I don't see any header being sent.

@hamburml
Copy link

hamburml commented Jul 1, 2023

I also need this. The UseCase is the following. I have a mp rest client interface in a library. The user of the library sometimes needs to send header, sometimes he does not. But the user of the library should not add a new interface which extends the interface from the library and adds RegisterClientHeaders Annotation. Instead he uses the RestClientBuilder and adds the header he needs programmatically. This is not possible right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants