I want to add two new header properties to all my api requests, instead of adding it one by one, is there a way I could append the new header properties, to the existing headers, that way I get to define the new header once and call it everywhere I need it. Something like:
So instead of this:
headers: {
'Content-Type': 'application/json',
'float-app': 'app Name',
'float-version': 'version',
},
I could do something like this:
newHeader: {
'float-app': 'app Name',
'float-version': 'version name',
}
headers: {
'Content-Type': 'application/json',
newHeader,
},
Currently with the above approach, I'm getting this:
headers: {
'Content-Type': 'application/json',
{
'float-app': 'app Name',
'float-version': 'version name',
},
},
Is there something I'm missing please?