I have an issue in using header in GET request in react native.
await fetch(Global.base_url + 'discount/category_list', {
method: 'GET',
headers: {
"Auth": Global.user_token,
"Accept": 'application/json',
"Content-Type": 'application/json',
}
})
.then(response => response.json())
.then(data => {
if(data.status == 1) {
Global.category_list = data.data;
} else {
Alert.alert("Warning!", 'Error');
}
})
.catch(function(error) {
Alert.alert('Warning!', 'Network error.');
});
I can't get response. Invalid token response. But in post man, it works well.
Please advance me if anyone can solve this issue. Thanks