I've looked a lot of places and I can't get my PUT route to work. I just want my PUT route to edit the id of the article specified in the route, here's what my route looks like:

```
/**
 * @return Response
 * @Route("/{id}", methods={"PUT"})
 * @param $id
 * @param Request $request
 */
public function edit($id, Request $request): Response
{
    $em = $this->getDoctrine()->getManager();
    $article = $em->find(Article::class,$id);
    if ($article)
    {
        $request->request->add(["article" => json_decode($request->getContent(), true)]);
        $form = $this->createForm(ArticleType::class, new Article())->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid())
        {
            $article->setNom($form["nom"]->getData());
            $article->setDescription($form["description"]->getData());
            $article->setPrix($form["prix"]->getData());
            $em->refresh($article);
            return $this->json($article, 205);
        }
        return $this->json(["error" => "Bad request"], 400);
    }
    return $this->json(["error" => "Not Found"], 404);
}

```

It seems good to me but not for Postman although it's not completely bad as it DOES get into the code! But it returns the 400 error code so I think it means it doesn't go inside the second if and I don't get why as I used a similar setup for my DELETE route. I'm trying my best to learn how routing works but for the PUT, I'm at a loss even after hours of searching so some help would really be appreciated!

If needed, here's the rest of the Controller code. And yes, I did tell my subscriber to allow "PUT" routes. Also, it's my first post, I hope it's good enough for this site's standards and loads of thanks to anyone willing to give me a little of their time!

```
    <?php

namespace App\Controller;

use App\Entity\Article;
use App\Form\ArticleType;
use App\Repository\ArticleRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

/**
 * Class ArticleController
 * @package App\Controller
 * @Route("/article")
 */
class ArticleController extends AbstractController
{
    /**
     * @return Response
     * @Route("/", methods={"GET"})
     * @param ArticleRepository $repository
     */
    public function index(ArticleRepository $repository): Response
    {
        return $this->json($repository->findAll());
    }

    /**
     * @return Response
     * @Route("/{id}", methods={"GET"})
     * @param $id
     */
    public function find($id): Response
    {
        $em = $this->getdoctrine()->getmanager();
        $article = $em->find(Article::class,$id);
        if ($article)
        {
            return $this->json($article, 201);
        }
        return $this->json(["error" => "Not Found"], 404);
    }

    /**
     * @return Response
     * @Route("/", methods={"POST"})
     * @param Request $request
     */
    public function new(Request $request): Response
    {
        $request->request->add(["article" => json_decode($request->getContent(), true)]);
        $form = $this->createForm(ArticleType::class, new Article())->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($form->getData());
            $em->flush();
            return $this->json($form->getData(), 201);
        }
        return $this->json(["error" => "Bad request"], 400);
    }

    /**
     * @return Response
     * @Route("/{id}", methods={"DELETE"})
     * @param $id
     */
    public function delete($id): Response
    {
        $em = $this->getdoctrine()->getmanager();
        $article = $em->find(Article::class,$id);
        if ($article)
        {
            $em->remove($article);
            $em->flush();
            return $this->json($article, 205);
        }
        return $this->json(["error" => "Not Found"], 404);
    }

```

Also, here's my Postman Request

```
{
    "nom": "test",
    "description": "description test",
    "prix": 7
}

```

And here's ArticleType.php

```
<?php

namespace App\Form;

use App\Entity\Article;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class ArticleType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nom')
            ->add('description')
            ->add('prix')
        ;
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => Article::class,
        ]);
    }
}

```