简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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