http 406 error on restful web service

2019-08-20 01:34发布

问题:

I have Spring MVC + JAXB web service and Flex client. I am getting HTTP 406 error when using RestFUL API. Here is request and response headers on image:

Can you help me for solving this problem?

回答1:

This problem comes when the data returned from the server is not in the format that is excepted by the browser. Also this can be caused by any one of the following:

  • Accept: The MIME types accepted by the browser. For example, HTML files, GIF files etc.
  • Accept-Charset: The character sets accepted by the client, e.g. utf-8, iso-8859-1 etc.
  • Accept-Encoding: The data encoding accepted by the client e.g. the file formats it understands, e.g. gzip.
  • Accept-Language: The natural languages (English, German etc.) accepted by the client.

Check what the server is returning and fix the problem!