Questions tagged [fosrestbundle]

A Symfony 2 plugin by FriendsOfSymfony (FOS) which provides various tools to rapidly develop RESTful API's with Symfony 2.

A Symfony 2 bundle by FriendsOfSymfony (FOS) which provides various tools to rapidly developer RESTful API's with Symfony 2.

Its features include:

  • A View layer to enable output and format agnostic Controllers
  • A custom route loader to generate url's following REST conventions
  • Accept header format negotiation including handling for custom mime types
  • RESTful decoding of HTTP request body and Accept headers
  • Exception controller for sending appropriate HTTP status codes

Links:

803 questions
-1
votes
1 answer

How to output 1x1 pixel from base64 using FOSRestBundle

I need to return this: return header('Content-Type: image/png'); echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII='); by using FOSRestBundle but I…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
-1
votes
1 answer

Subrequests with post vars

Here's the big picture: I am writing a symfony2 bundle for my web application. This application consists in a standard website with CRUD controllers. And on the other side it contains a rest api that also manages creation/edit/... on entities. I…
F.L.
  • 559
  • 4
  • 11
-2
votes
2 answers

Adding services to a Controller through "container.service_subscriber" not working as expected

I am trying to use the container.service_subscriber tag on my Controller to make some services available without injecting them through the constructor. In our project we don't want to use the autowiring and also can't use the autoconfigure…
enricog
  • 4,226
  • 5
  • 35
  • 54
-2
votes
1 answer

POST request is considered as GET

My problem is that my controller handles the POST method like GET. When I try to pass arguments to a post method it gives me the GET results because they have the same syntax. My POST function is as follows: /** * @ApiDoc(description="Uploads photo…
anony
  • 185
  • 2
  • 14
-2
votes
1 answer

Why we are using Jms Serializer in Symfony

I have Used FosRestBundle in my project.In the Documentation they used the JmsSerializer.I want know how it could be used.
priya
  • 23
  • 1
-3
votes
1 answer

Best practice - How to respond with different entity views to improve performance in a RESTful API (Symfony 4)

When listing an using a REST index endpoint I would like to have different outputs for performance reasons. ex: on the same GET path for CRUD indexing - List of Entities with all associations - List of Entities with some associations - List of…
Roberto
  • 403
  • 2
  • 9
-3
votes
1 answer

Limit login attempts under Symfony 4 and FOSRestBundle

I use FOSRestBundle in Symfony 4 and I want to secure my Login Form using this. I want to set up a limited number of connection attempts on the login form (5 maximum for 15 minutes, then 30 minutes then 1 hour) I have search and i have found this…
-3
votes
1 answer

FOSRestBundle & JMSSerializer : Wrong Json Response

In the same response i get a field as object and a field as Array, how can i correct this ? Note i don't controle the building of my response because i'm using JMSSerializer CODE (Edit 1) \Entity\Profil.php class Profil { …
TooCool
  • 10,598
  • 15
  • 60
  • 85
1 2 3
53
54