Answers for "fetch api flask url redirect"

0

fetch api flask url redirect

fetch('url',{
    method:'POST'                
    }) 
    .then((response)=>{         
        if(response.redirected){
            window.location.href = response.url;
        }
    })           
    .catch(function(e){
        
    })
Posted by: Guest on October-25-2021
0

fetch api flask url redirect

//python
flash('some message for index page')  
return redirect(url_for('index'))

//js
fetch('url',{
    method:'POST'                
    }) 
    .then((response)=>{         
        if(response.redirected){
            window.location.href = response.url;
        }
    })           
    .catch(function(e){
        
    })
Posted by: Guest on October-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language