i try to make http post request to my controller from the js. In localhost everything works perfectly, but when I deploy app on IIS, then fetch cut some part of path and return 404 not found.
Application is deploy on: https://example.com/ApplicationName/
Fetch url is: https://example.com/Home/Update/?switcher=false
But should be: https://example.com/ApplicationName/Home/Update/?switcher=false
Fetch:
let url = '/Home/Update/?switcher=' + switcher;
await fetch(url, {
method: 'POST'
})
.then(function (response) {
if (response) {
toggleChatSwitch.disabled = false;
}
});
Controller:
[HttpPost]
public bool Update(bool switcher)
{
[...]
}