Intento hacer una solicitud de publicación http a mi controlador desde js. En localhost todo funciona perfectamente, pero cuando implemento la aplicación en IIS, busco cortar una parte de la ruta y devuelvo 404 no encontrado.
La aplicación se implementa en: https://example.com/ApplicationName/
La URL de recuperación es: https://example.com/Home/Update/?switcher=false
Pero debería ser:https://example.com/ApplicationName/Home/Update/?switcher=false
Buscar:
let url = '/Home/Update/?switcher=' + switcher; await fetch(url, { method: 'POST' }) .then(function (response) { if (response) { toggleChatSwitch.disabled = false; } });Controlador:
[HttpPost] public bool Update(bool switcher) { [...] }