简体   繁体   English

当数据包含ajax发布到php时,结果为406

[英]ajax post to php results in 406 when data contains <meta

<meta (is what is typed into the form field) form submitted thru jQuery ajax <meta (是在form字段中键入的内容)通过jQuery ajax提交的表单

On my dev server (php 5.3.5) it works fine. 在我的开发服务器(php 5.3.5)上,它可以正常工作。 On the production server (php 5.3.27) it returns 406. 在生产服务器(php 5.3.27)上,它返回406。

I can't seem to troubleshoot this on the dev server because the server returns 406 before php is invoked. 我似乎无法在开发服务器上解决此问题,因为服务器在调用php之前返回406。

When form data is submitted without <meta , it works no problem. 提交表单数据时不带<meta ,则没有问题。

The form also has a wysiwyg editor and markup tags like <h1> cause no error. 该表单还具有所见即所得的编辑器,并且<h1>类的标记标签不会导致任何错误。

I made a basic form without ajax, it posts <meta without problem. 我做了一个没有ajax的基本表单,它发布了<meta没问题。

How can I troubleshoot this further to see what the server thinks it is receiving and why it thinks it is NOT ACCEPTABLE? 如何进一步解决此问题,以查看服务器认为正在接收的内容以及为什么认为它不可接受?

A browser will indicate what it can accept via a number of Accept headers in the request. 浏览器将通过请求中的多个Accept标头指示其可以接受的内容。 If the server wants to return something that the browser will not accept it issues a 406 response. 如果服务器要返回浏览器不接受的内容,则会发出406响应。

Check the headers being sent to the server from your browser (Firebug or Chrome's developer tools will help) 检查从浏览器发送到服务器的标头(Firebug或Chrome的开发人员工具会有所帮助)

Check the server configuration (specifically any .htaccess files) and make sure that the server can respond in an appropriate way. 检查服务器配置(特别是任何.htaccess文件),并确保服务器可以适当的方式响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM