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

Responding to different content type

 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading Oracle docs https://docs.oracle.com/cd/E19776-01/820-4867/ghrpv/ which says


If no methods in a resource are able to produce the MIME type in a client request, the Jersey runtime sends back an HTTP “406 Not Acceptable” error


So I wrote below code to see 406 error



Now If I make a get request with content-type application/xml it should give me 406 error in response but it returns GET called

406.PNG
[Thumbnail for 406.PNG]
Request with Content-Type application/xml
 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it, it should be Accept header not Content-Type header
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic