RestClient calls with arbitrary headers #42279
steelThread
started this conversation in
Community
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm sorry if this isn't the appropriate place for this type of question. In any case I'm working on an integration with a legacy API endpoint with a couple of auth alternatives. The gist is if an authenticated client originates a request, it requires consumers to pass a cookie, while system-system (internal) integrations require an auth header with a bearer token. I was putting together a quick RestClient for this, but I couldn't find something I was looking for: passing arbitrary headers to a RestClient method. There are some nice mechanisms to support custom headers, but a simple
@Headers
param anno with a multimap would be clean for situations where the same endpoint supports different header protocols. The factory approach doesn't fit cleanly because I have other endpoints in the RestClient that don't have this requirement.In any case, thought I might be missing something that this group could enlighten me on. I can work around this in several ways, so it's not a problem.
Beta Was this translation helpful? Give feedback.
All reactions