简体   繁体   English

Symfony Route找不到“ GET / articles /”

[英]Symfony Route Not found “GET /articles/”

I'm following this tutorial: 我正在关注本教程:

https://openclassrooms.com/courses/construisez-une-api-rest-avec-symfony/introduction-a-la-serialisation-avec-jmsserializer https://openclassrooms.com/courses/construisez-une-api-rest-avec-symfony/introduction-a-la-serialisation-avec-jmsserializer

I did what the teacher want me to do, but when I try to access http://api/app_dev.php/articles I get the following error: 我做了老师要我做的事情,但是当我尝试访问http://api/app_dev.php/articles时 ,出现以下错误:

No route found for "GET /articles/" 找不到“ GET / articles /”的路线

debug router 调试路由器

function in error 功能错误

Mycontroller the controller Mycontroller 控制器

在您的debug:routes它显示路由/ article是POST而不是GET ,请将方法从POST更改为GET,请在您的控制器或路由文件中

The route you try is /articles/ 您尝试的路线是/ articles /

But the route defined is /articles 但定义的路线是/ articles

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

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