'extract csv file from url in react

i have a url which onclick downloads me a csv file.I want to fetch data from that url and show it in console.How can i do it?

 const downloadCsv = async () => {
            try {
                const target = `https://connect.emgsrv.com/wT3Kjzu4B3P43VQikYjq/wT3Kjzu4B3P43VQikYjq.CSV`; //file

                
                const res = await fetch(target, {
                    method: 'get',
                     mode: 'no-cors',

                    
                    headers: {
                        'content-type': 'text/csv;charset=UTF-8',
                        //'Authorization': //in case you need authorisation
                    }
                });
        
             
        
                    const data = await res.text();
                    console.log(data,'hahah');
        
                
            } catch (err) {
                console.log(err)
            }
        }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source