title: Twitter Stream API - 401 Unauthorized
body: <p>I can't open a connection with Twitter Stream API. The only response I can get, no matter what I try, is <code>401 Unauthorized</code>.</p>
  
  <p>I've made all kinds of tests, even using some libraries I've found on GitHub.</p>
  
  <p>Even outside my code, using cURL, I can't make it work.</p>
  
  <pre><code>$oauth = array( 
      'oauth_consumer_key' =&gt; $this-&gt;m_oauth_consumer_key,
      'oauth_nonce' =&gt; time(),
      'oauth_signature_method' =&gt; 'HMAC-SHA1',
      'oauth_token' =&gt; $this-&gt;m_oauth_token,
      'oauth_timestamp' =&gt; time(),
      'oauth_version' =&gt; '1.0'
  );
  
  $base_info = $this-&gt;buildBaseString($this-&gt;url, 'GET', $oauth);
  $composite_key = rawurlencode($this-&gt;m_oauth_consumer_secret) . '&amp;' . rawurlencode($this-&gt;m_oauth_token_secret);
  $oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true));
  $oauth['oauth_signature'] = $oauth_signature;
  $header = $this-&gt;buildAuthorizationHeader($oauth);
  </code></pre>
  
  <p>This is my code for building HTTP Request Header and Signature. I've tried in a lot of different ways, no success.</p>
  
  <p>Anoyone have any ideia that could help me?</p>
  
  <p>Thank you in advance.</p>