• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Accept Header

 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I make a get request against the web service , a1 method is called



Here is request header


I don't understand why method a1 is called, its clearly says that it produces text/plain and Accept header from client request says its ready to accept anything. Then why method a1 is called
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65680
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know specifically, but if you think about it, all three methods match the accept criteria, so why wouldn't a1 be called? It's likely arbitrary (or in sorted order, or some other internal criteria).

I assume this is Jersey? If so, I'd look into the specification to see if it outlines how ambiguities are resolved.
 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes client is ready to accept anything as the Accept header is */* , which makes all three methods equal contender to be called. Then why specifically a1 is called
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65680
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:I'd look into the specification to see if it outlines how ambiguities are resolved.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!