标签:dump name cab body ges host src size cep
一、js:<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="jquery.min.js"></script>
</head>
<body>
<script>
$.ajax({
‘url‘:‘http://localhost/index.php‘,
‘data‘:{‘sex‘:‘male‘},
‘beforeSend‘:function(xhr){
xhr.setRequestHeader(‘name‘,‘lee‘);
xhr.setRequestHeader(‘sex‘,‘male‘);
xhr.setRequestHeader(‘height‘,‘168‘);
},
‘success‘:function(data){
console.log(data);
}
});
</script>
</body>
</html>
<?php
header(‘Access-Control-Allow-Origin:*‘);
header(‘Access-Control-Allow-Credentials: true‘);
header(‘Access-Control-Allow-Methods:GET,PUT,POST,DELETE,OPTIONS‘);
header(‘Access-Control-Allow-Headers:WWW-Authenticate,Authorization,Set-Cookie,X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version,name,sex,height‘);
$header = apache_request_headers();
var_Dump($header);exit;
标签:dump name cab body ges host src size cep
原文地址:http://blog.51cto.com/12173069/2066641