About add custom request headers
Hello guys,
In our project, we plan to add a global custom header to the request header sent to magento.
and we are using
I know that fixed request headers can be set in middleware.config.js, for example:
We tried adding a global custom request header context in the middleware, but when going through Apollo, it was converted into a get request, and the relevant header did not exist
so How should I add a global custom request header? maybe i need a help
thanks.
In our project, we plan to add a global custom header to the request header sent to magento.
and we are using
magento-api, which uses apollo-client, and use get header to setcontent-currency & storeI know that fixed request headers can be set in middleware.config.js, for example:
customApolloHttpLinkOptions: {
useGETForQueries: true,
headers: {
'custom-header': 'custom-header-value',
'client-secret': 'xxxxxxxxx'
},
},
, But how to set dynamic global request headers?
We tried adding a global custom request header context in the middleware, but when going through Apollo, it was converted into a get request, and the relevant header did not exist
so How should I add a global custom request header? maybe i need a help
thanks.