简体   繁体   English

Angular metronic 模板错误 - Http 故障响应:405 Method Not Allowed

[英]Angular metronic template error - Http failure response : 405 Method Not Allowed

login api takes two parameters: username, password on checking in google chrome developer mode, following error appears登录 api 需要两个参数:用户名,密码在谷歌浏览器开发者模式下检查,出现以下错误

Http failure response for http://localhost:31557/api/Authenticate/login: 405 Method Not Allowed
(anonymous) @ intercept.service.ts:45
push../node_modules/rxjs/_esm5/internal/operators/tap.js.TapSubscriber._error @ tap.js:55
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error @ Subscriber.js:59
push../node_modules/rxjs/_esm5/internal/OuterSubscriber.js.OuterSubscriber.notifyError @ 
OuterSubscriber.js:13
push../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.InnerSubscriber._error @ 
InnerSubscriber.js:18
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error @ Subscriber.js:59
onLoad @ http.js:1707
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:423
onInvokeTask @ core.js:26247
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:422
push../node_modules/zone.js/dist/zone.js.Zone.runTask @ zone.js:195
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask @ zone.js:498
invokeTask @ zone.js:1693
globalZoneAwareCallback @ zone.js:1730
load (async)
customScheduleGlobal @ zone.js:1832
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.js:1
Show 174 more frames

Method not allowed indicated that your backend is expecting a different HTTP verb.不允许的方法表明您的后端需要不同的 HTTP 动词。 Usually one uses POST for login requests but this really depends on your backend.通常使用 POST 进行登录请求,但这实际上取决于您的后端。 The stacktrace here is not really helpful.这里的堆栈跟踪并不是很有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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