我正在尝试使用axios(Vue.js)发出发布请求。
This is request:
subscribe() {
console.log('entered subscribe');
ApiService.post('/user/subscribe',
{
email: this.email
}
)
.then(response => {
this.resp = response;
console.log('successfully subscribed: ');
}).catch(e => {
console.error(e);
});
}
This is ApiService:
import axios from 'axios'
export default axios.create({
baseURL: 'http://localhost:8080/cryptonews',
timeout: 5000,
})
问题在于该应用程序正常运行,它已连接到服务器,但我无法发布错误。