AlokaiA
Alokaiโ€ข3y agoโ€ข
19 replies
akie

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 magento-api, which uses apollo-client, and use get header to setcontent-currency & store

I 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?prestashop

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.๐Ÿค
Was this page helpful?