Can't use setHeader(Header) because ambigous method call
See original GitHub issueHeader is both a Header and a Map so this won’t work:
Header header = new DefaultHeader();
String payloadWithoutPartner1 = Jwts.builder()
.setClaims(claims)
.signWith(SignatureAlgorithm.HS256, key)
.setHeader(header)
.compact();
Ambiguous method call. Both setHeader (Header) in JwtBuilder and setHeader(Map<String, Object>) in JwtBuilder match
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:19 (5 by maintainers)
Top Results From Across the Web
CORS Policy won't work, because all response headers are ...
I trie to get a response from my POST Method in my Servlet java class. I trie to set all headers ...
Read more >"The method X is ambiguous for the type Y" Java ambiguous ...
Suppose we have a java program like below. Above program compiles perfectly and when we run it, it prints “String”.
Read more >tornado.web — RequestHandler and Application classes
Clears an outgoing header, undoing a previous set_header call. Note that this method does not apply to multi-valued headers set by add_header ....
Read more >Spring Integration Reference Manual
Also, in the second example above, you can see how to set any user-defined header with setHeader . Finally, there are set methods...
Read more >HttpRequest.getHeader('Content-Length')) returns null
Content-Length is a header that's automatically calculated on your behalf. You can set it, but it'll be ignored (because the Body attribute ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lhazlewood using
Jwts.header()
doesn’t change anything. Standard technique or not compiler won’t know which overload version to use, cause both are applicable. This is the simplest thing you can paste and check for yourself:Casting to map
.setHeader((Map<String, Object>) header)
worksLike the last entry stated, I used
setHeaderParam
, instead.