title: fos rest custom get url in symfony2
body: <p>I need to create a custom url in my rest api. I am using fos rest bundle.</p>
  
  <p>custom URL is like:</p>
  
  <pre><code>http://myapi.com/api/v1/public/users/confirm?cd=&lt;some_code&gt;.json
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>@GET("/users/confirm?cd={cd}")
  </code></pre>
  
  <p>and when I run:</p>
  
  <pre><code>php /app/console route:debug
  </code></pre>
  
  <p>I am getting this:</p>
  
  <pre><code>...
  ....
  get_confirm GET ANY ANY  /api/v1/public/users/confirm?cd={cd}.{_format}
  ...
  ...
  </code></pre>
  
  <p>but in my test when I try to hit this URL I get:</p>
  
  <pre><code>No route found for &amp;quot;GET /api/v1/public/users/confirm&amp;quot; (404 Not Found)
  </code></pre>
  
  <p>can anyone help me in this. How to form such URLs.</p>
  
  <p>My Controller Action Code:</p>
  
  <pre><code>/*
   * @GET("/users/confirm?cd={cd}")
   */
  public function getConfirmAction($cd) {
  
      //Some code for user confirmation
  
      return return View::create(array('successmessage'=&gt;'Your account has been verified successfully. Please login.', Codes::HTTP_OK);
  }
  </code></pre>
  
  <p>PHPUnitTest Code:</p>
  
  <pre><code>public function testGetConfirmThrowsInvalidArgumentException() {
      $this-&gt;client-&gt;request(
                  'GET', '/api/v1/public/users/confirm?cd=abcd123.json'
          );
  
          $response = $this-&gt;client-&gt;getResponse();
  
          print_r($response-&gt;getContent());
          exit(__METHOD__);
  }
  </code></pre>