RESTful Web 服务上的 http 406 错误 [英] http 406 error on restful web service

查看:27
本文介绍了RESTful Web 服务上的 http 406 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 Spring MVC + JAXB Web 服务和 Flex 客户端.使用 RestFUL API 时出现 HTTP 406 错误.这是图像上的请求和响应标头:

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?

推荐答案

当从服务器返回的数据不是浏览器排除的格式时,就会出现此问题.此外,这可能是由以下任何一种情况引起的:

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:

  • 接受:浏览器接受的 MIME 类型.例如,HTML 文件、GIF 文件等.
  • Accept-Charset:客户端接受的字符集,例如utf-8、iso-8859-1 等
  • Accept-Encoding:客户端接受的数据编码,例如它理解的文件格式,例如gzip.
  • Accept-Language:客户接受的自然语言(英语、德语等).
  • 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!

这篇关于RESTful Web 服务上的 http 406 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆