title: What is the best way to retrieve data from a URL protected by credentials in Symfony2?
body: <p>I can retrieve data (JSON) from a route protected by credentials in a Symfony2 project, but for that I use <code>file_get_contents($url, $include_path, $context)</code> with <code>stream_context_create($options)</code>. Without the context it failed to open the stream.</p>
  
  <p>What's the best way to do this kind of operations? There is some simple Symfony's API ?</p>