I am using a lot of API's in my React Native app. In a lot of places i'm using bearer token for different purposes. Right now it looks like:
getCustomerProfile: async token => {
return await fetch(
`MY API`,
{
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
}
)
.then(response => response.json())
.then(json => {
return json;
})
.catch(error => warn(error));
},
But now i don't want to use headers and just want to use params for getting response. In postman my API works fine with params. But how can i change here to get response using params instead of headers?