简体   繁体   English

axios 发布请求,没有正文到达没有标头的服务器

[英]axios post request without body getting to the server without the headers

the request getting to the server without the headers:没有标头的请求到达服务器:

 const res = await axios.post(`/api/follow/${props.match.url}`, { headers: { Authorization: `Bearer ${token}`, userId: userId, }, });

anyone knows why?有谁知道为什么?

should just put null in the body place, and it works应该把 null 放在身体的地方,它就可以工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM