Saturday, January 15, 2022

[FIXED] PHP MAMP and server conflicts

Issue

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


Solution

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)



Answered By - Gordon Bailey

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.