当 React 应用程序。加载后,我可以通过“window.location.search”从当前页面的 url 获取查询参数。同样,我想读取请求 header 。如何读取React中的请求头?
最佳答案
如果不通过 javascript 发送 http 请求,就不可能在 React 中获取页面的请求 header 。
引用答案:
https://stackoverflow.com/questions/44354763/how-do-i-get-http-headers-in-react-js
How can I read the current headers without making a new request with JS?
关于reactjs - 如何在React中读取请求头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63914480/