Mpampinos Holmens
Mpampinos Holmens

Reputation: 1937

PHP MAMP and server conflicts

I have a page that calls a php script. On MAMP everything works fine but when I upload it to a server I get the following error:

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...").

Has anyone seen anything like that?

you can check it yourself here just place a word like php or ios

Upvotes: 0

Views: 127

Answers (2)

Gordon Bailey
Gordon Bailey

Reputation: 3911

It looks like your server is validating based on the content-type header. It seems to want text/xml, whereas you are sending application/x-www-form-urlencoded (which is the default for $.ajax).

Try explicitly setting the content type to text/xml in your $.ajax call. (reference)

Upvotes: 1

Gntem
Gntem

Reputation: 7165

try changing charset=utf-8 to charset=UTF-8

Upvotes: 1

Related Questions