简体   繁体   English

REST API如何路由到使用FOSRestBundle创建服务的后端控制器?

[英]how is a REST API is routed to back end controller where FOSRestBundle is used to create services?

Here is a scenario - http://ic.local/api/adds/disclosuers is the URL to create a disclouser and on click of form submit below data gets POST to the URL. 这是一个场景-http://ic.local/api/adds/disclosuers是创建Disclouser的URL,单击表单提交后,单击下面的数据将获取POST到URL。

{"gm_restbundle_tdtlsdisc":{"isClassified":"N","isExportControl":"N","discTitle":"test","firstRecordedDate":"06-December-2016","estimatedTime":"5","shareOutsideGM":"N"}}

But when I look into backend PHP Symfony code I am not able to locate which controller is handling this POST request. 但是当我查看后端PHP Symfony代码时,无法找到哪个控制器正在处理此POST请求。 There is not such adds class having disclosuers method. 没有具有disclosuers方法的adds类。

If FOSRestBundle is used, will it carry any different mechanism? 如果使用FOSRestBundle ,它将采用任何其他机制吗? I searched for adds/disclosuers all over the project. 我在整个项目中搜索adds/disclosuers but I see it only in one Angular JS file where the POST URL is mentioned. 但我只能在提到POST URL的一个Angular JS文件中看到它。

I am clueless. 我无能为力。

Use debug to debug your router. 使用debug调试路由器。

app/console debug:router will show you the list of registered routes app/console debug:router将向您显示已注册路由的列表

app/console debug:router ROUTE_NAME will show you details of specific route including controller attached to this route app/console debug:router ROUTE_NAME将向您显示特定路由的详细信息,包括与此路由相连的控制器

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

相关问题 FOSRestBundle的REST服务 - REST Services For FOSRestBundle FOSRestBundle:如何在我的Rest Api中将数组设置为URL - FOSRestBundle: How to set an array to an URL in my Rest Api 如何使用FOSRestBundle和FOSOauthServerBundle保护REST API中的用户资源? - How to protect the resources of a user in a REST API with FOSRestBundle and FOSOauthServerBundle? Symfony2 FOSRESTBundle REST API返回PDF - Symfony2 FOSRESTBundle REST API to return PDF 使用FOSRestBundle REST API设置注册FOSUserBundle - Set up registration FOSUserBundle with FOSRestBundle REST API 如何为Yii2创建文件上载REST API控制器 - How to create a file upload REST API controller for Yii2 如何在Laravel 5.4中为PayPal REST API创建“ CreatePayment”和“ PaymentExecute”控制器 - How to create “CreatePayment” and “PaymentExecute” controller for PayPal REST api in laravel 5.4 我如何创建一个后端系统,用于在图像上传之前为图像添加超链接和标题 - How can I create a back end system used for adding hyperlinks and captions to images before their uploaded Symfony 2 - FOSRestBundle - 从另一个控制器调用api方法 - Symfony 2 - FOSRestBundle - Call api method from another controller 如何使用 FOSRestBundle 在 Symfony 4 Controller 的所有方法中设置自定义标头? - How to set custom headers in all methods of a Symfony 4 Controller with FOSRestBundle?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM