![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 428 Pomógł: 77 Dołączył: 10.07.2011 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Witajcie
Staram się przepisać istniejące API aplikacji na FOS Rest i... tyle o ile, z większością akcji nie mam problemu, to tutaj dzieje się coś dziwnego Akcja w kontrolerze:
app/config/routing.yml Kod api: resource: "@ApiBundle/Resources/config/routing.yml" type: rest prefix: /api options: i18n: false @ApiBundle/Resources/config/routing.yml Kod api_user_search: path: /user/search defaults: _controller: ApiBundle:User/UserEndpoint:getFindUser methods: [GET] I teraz, wysyłajac request GET na adres /api/user/search?phrase=xyz mój profiler twierdzi, że w/w request nie ma parametrów GET, a co za tym idzie dostaję błędem: Kod {"code":400,"message":"Query parameter \"phrase\" is empty"} Na domknięcie, config fos_rest: Kod fos_rest:
format_listener: false routing_loader: default_format: json include_format: false view: view_response_listener: force force_redirects: html: true formats: jsonp: true json: true xml: false rss: false templating_formats: html: true mime_types: json: ['application/json', 'application/x-json'] rss: 'application/rss+xml' jpg: 'image/jpeg' png: 'image/png' jsonp_handler: ~ body_listener: true param_fetcher_listener: force allowed_methods_listener: true access_denied_listener: json: true routing_loader: default_format: ~ exception: codes: 'Symfony\Component\Routing\Exception\ResourceNotFoundException': 404 'Doctrine\ORM\OptimisticLockException': HTTP_CONFLICT messages: 'Symfony\Component\Routing\Exception\ResourceNotFoundException': true serializer: groups: - REST Ten post edytował kpt_lucek 31.12.2015, 13:50:19 -------------------- Cytat There is a Bundle for that Lukas Kahwe Smith - October 31th, 2014 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 19.08.2025 - 13:48 |