axios发送post请求[body-parser]--['Content-type': 'application/x-www-form-urlencoded']
const express = require('express') const axios = require('axios') const bodyParser = require('body-parser') const app = express() const apiRoutes = express.Router() app.use('api/', apiRoutes) app.use(bodyParser.urlencoded({extended: true})) // 获取歌曲播放地址 app.post('/api/getPurlUrl', bodyParser.json(), function (req, res) { const url = 'https://u.y.qq.com/cgi-bin/musicu.fcg' axios.post(url, req.body, { headers: { referer: 'http://ustbhuangyi.com/music/', origin: 'http://ustbhuangyi.com', 'Content-type': 'application/x-www-form-urlencoded' } }).then((response) => { res.json(response.data) }).catch((e) => { console.log(e) }) })