PHP MAMP与服务器冲突

PHP MAMP与服务器冲突,php,command-line-interface,mamp,Php,Command Line Interface,Mamp,我有一个调用php脚本的页面。在MAMP上,一切正常,但当我将其上载到服务器时,会出现以下错误: Call Request failed! Status code: 4000 Reason - Caught an HttpRequestValidationException due to some bad characters in the request. Make sure your post request is encoded as xml, preferable as UTF-8 ('

我有一个调用php脚本的页面。在MAMP上,一切正常,但当我将其上载到服务器时,会出现以下错误:

Call Request failed! Status code: 4000
Reason - Caught an HttpRequestValidationException due to some bad characters in the request. Make sure your post request is encoded as xml, preferable as UTF-8 ('Content-Type: text/xml; charset=utf-8'). Exception: A potentially dangerous Request.Form value was detected from the client (<?xml version="..."utf-8"?> <uclassify xmlns="ht...").
呼叫请求失败!状态代码:4000

原因-由于请求中的某些错误字符,捕获了HttpRequestValidationException。确保您的post请求编码为xml,最好是UTF-8('Content-Type:text/xml;charset=UTF-8')。异常:潜在危险的请求。从客户端检测到表单值(尝试将
charset=utf-8
更改为
charset=utf-8

看起来您的服务器正在基于
内容类型
头进行验证。它似乎想要
文本/xml
,而您正在发送
应用程序/x-www-form-urlencoded
(这是
$.ajax
的默认值)


尝试在
$.ajax
调用中显式地将内容类型设置为
text/xml

类似于$.ajax({type:“POST”,content-type:“content-type:text/xml;charset=UTF-8”,url:“questions.php”,data:{amount”:amount},类似这样的:
$.ajax({type:“POST”,content-type:“text/xml;charset=UTF-8”、/*等*/
您刚才复制粘贴了我键入的内容吗?您只需在
内容类型
字段中添加值
“text/xml;charset=UTF-8”“
。好的。它的contenttype不是content type,但我得到了相同的错误!没有更改!尝试
contenttype
而不是
contenttype
。我相信它区分大小写。