【发布时间】:2020-01-13 13:01:48
【问题描述】:
我按照教程使用外部 API 制作登录页面,但我的 API 无法正常工作。
在 localhost http://localhost:8000/api/auth/login 中出现“此路由不支持 GET 方法。支持的方法:POST。”在 Chrome DevTools 中
headers: HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}
message: "Http failure response for http://127.0.0.1:8000/api/auth/register: 422 Unprocessable Entity"
name: "HttpErrorResponse"
ok: false
status: 422
statusText: "Unprocessable Entity"
url: "http://127.0.0.1:8000/api/auth/register"
我使用 laravel 6,php 7,离子 4
请帮帮我!
(教程为:https://blog.flicher.net/laravel-rest-api-passport-authentication-for-ionic-app/)
【问题讨论】:
-
检查您的路线。在 cmd 或终端的根目录下运行
php artisan route:list。检查给定路线的http verb。