Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
Pie
Posts: 65335
97
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
Pie
Posts: 65335
97
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic