https://api.twitter.com/1.1/friends/list.json
Error that i am getting is that about cors, though i have manage it from browser side
Here is my code that i use for fetch user
const response = await fetch('https://api.twitter.com/1.1/friends/list.json',{
method: 'GET',
headers : {
"Content-Type": "application/json;charset=UTF-8",
'Authorization' : 'Bearer my_token'
}
})
The Twitter API does not support CORS and you cannot call it in a browser in this manner. You will need to use server-side code.
(additionally, the v1.1 API you are trying to use is a legacy API and you would be better to look at v2 - the equivalent is the Follows lookup functionality)