jquery - ajax post to php returns $_SERVER['REQUEST_METHOD'] GET -


i'm trying post newsletter form data php page ajax when echo $_server['request_method'] on php page prints get(with no variables). have used similar code on multiple websites no problems. (jquery v3.2.1)

  $.ajax({             method: 'post',              datatype: 'json',             url: '<?=$site_url?>/templates/xxxx/contact_send/email_send.php',             data: json.stringify(datastring),             contenttype: 'application/json;charset=utf-8',             success: function () {                 console.log('success');             }         }); 

network log

network log

echo $_server['request_method'] echo $_server['request_method']

response

response

browser of method get....(second image)

you should see network log image response


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -