I’m leveraging .NET Razor pages for my proxy applications, and so i have been able to successfully leverage jquery to make GET requests from my Razor View to my Razor backend.
However, I have yet to figure out how this is done for POST requests without getting a 400 error.
the structure of my ajax calls are generally as such:
$.ajax({
type: ‘POST’,
url: ‘/apps/proxyappname?handler=UpdateInfo’,
data: JSON.stringify(formData),
contentType: ‘application/json’,
dataType: ‘json’,
success: function (response) {
console.log(“Update successful:”, response);
},
error: function (xhr, status, error) {
console.log(“XHR:”, xhr);
console.log(“Status:”, status);
console.log(“Response Text:”, xhr.responseText);
}
});
is there something that has to be passed in addition? Thank you guys