fetch('url',{ method:'POST' }) .then((response)=>{ if(response.redirected){ window.location.href = response.url; } }) .catch(function(e){ })