假设我正在使用Vue.js构建一个web应用程序,其中终端用户使用表单订阅时事通讯。前端是一个Vue应用程序,后端是一个PHP。
API需要基本的Auth身份验证。
在前面,我使用axios调用API:
axios
.post('localhost/api/v1/subscriber.php', {
// I know the data is missing but this is not what the question is about..
auth: {
username: 'USER',