write in pre-requrest/prepare
pm.request.addHeader('Accept: application/json')
write in tests
const data = pm.response.json();
if(data && data['token']) {
const token = data['token'];
pm.environment.set('bearer_token', token)
pm.collectionVariables.set('bearer_token', token)
}