$ (function () {$ ("#test"). Click (function () {$.ajax () {//URL: "http://110.87.98.218: 40001/doctor/list ",Url:"HTTP://LOCALHOST:32186/PERSON/ADD", data: {Name:" One", Sex:"male", Birthday:"1988-07-06 00:00:00", Idtype:1, Idno:"350426198807066134", Phone:"18060922856", Email:"", Address:"", ZipCode:"361008", Cardno:"D69372261", IsDefault:1 }, //data:{deptid: "E45b4c81-c467-41d6-bd27-97755592af02"},Type"POST", DataType:"JSON", headers: {Token:'2c16a1a3b40fda7fe3f2109efff5b7c8'//here is token }, Async:false, Cache:false, Success:function (data) {Console.log (data); }, Error:function (e) {console.log (data); } }); }); })
Of course, the background to get check token is var token = system.web.httpcontext.current.request.headers["token"]; Obtained, if the "" Number inside the token to replace, JS Token also replaced by the same
Ajax submits data with tokens