Symfony FOS rest捆绑包未从API URL获取我的json数据
我正在尝试调用此api:Symfony FOS rest捆绑包未从API URL获取我的json数据,json,symfony,routes,fosrestbundle,Json,Symfony,Routes,Fosrestbundle,我正在尝试调用此api:http://localhost/api/columns {“选项卡”:“客户端”} 但我无法从json格式中获取该值 我从浏览器中得到此错误:{“code”:404,“消息”:“找不到\“get\/api\/列%20%7B%22选项卡%22:%22客户端%22%7D\”的路由。 来自CURL的提示:{“code”:400,“message:”值“NULL”的“Parameter\”tab\”违反了约束“此值不应为NULL.\”“} 这是我的fos_rest.yml文件:
http://localhost/api/columns {“选项卡”:“客户端”}
但我无法从json格式中获取该值
我从浏览器中得到此错误:{“code”:404,“消息”:“找不到\“get\/api\/列%20%7B%22选项卡%22:%22客户端%22%7D\”的路由。
来自CURL的提示:{“code”:400,“message:”值“NULL”的“Parameter\”tab\”违反了约束“此值不应为NULL.\”“}
这是我的fos_rest.yml文件:
fos_rest:
routing_loader: false
body_listener: true
exception:
enabled: true
param_fetcher_listener: force
view:
view_response_listener: 'force'
formats:
json: true
format_listener:
rules:
- { path: '^/api', prefer_extension: false , priorities: [json], fallback_format: json}
地址:yml
dashboard:
type: rest
resource: App\Controller\DashboardController
prefix : api
我从以下位置获得的信息:php bin/console debug:router
检查我的路由:
get_columns GET ANY ANY /api/columns.{_format}
什么?与您的路由匹配的url是/api/columns.json。如何更改它,它是从fos rest捆绑包自动生成的路由