I sent a token from a View to a function in my HomeController, and now I need to process the token and send back the information to the frontend. I assumed that the resultData returned by the ajax call would be the output of GetMyData, but it turns out it's just the original token I passed in. Any assistance on this matter would be greatly appreciated. Thank you.
JS
$.ajax({
url: '/Home/GetMyData',
type: 'POST',
dataType: 'json',
data: {token: token},
success: function(resultData){
console.log(resultData);
}
})
Home Controller
public JsonResult GetMyData(string token)
{
...
return Json('ok')
}