title: Twitter API 401 when try to get friends list
body: <p>I try to obtain list of friends and actually CAN'T use any api, like twitter and OAuth (it's studying task actually)
  I successfully do request_token and access_token. But after it i try to get friends/list.json and get 401 (32 we couldn't authorize you)
  <pre><code>
  def get_friends(self):
      address = "<a href="https://api.twitter.com/1.1/friends/list.json" rel="nofollow">https://api.twitter.com/1.1/friends/list.json</a>?" + self.user_id
      params = {
          'oauth_token': self.token,
          'oauth_timestamp': int(time.time()),
          'oauth_nonce': self.get_nonce(),
          'oauth_signature_method': 'HMAC-SHA1',
          'oauth_version': '1.0',
          'oauth_consumer_key': self.consumer_key
      }
      params['oauth_signature'] = self.get_sign(address, params, 'GET')
      http_request = Request(address)
      http_request.add_header("Authorization", self.get_header(params))
      try:
          received = (urlopen(http_request,
                              bytes('', 'ascii')).read())
      except Exception as e:
          print(e.read())</p>
  
  <p>def get_sign(self, address, params, method):
      sorted_params = sorted(params.items())
      params_string = ''
      for param in sorted_params:
          params_string += '{}={}&amp;'.format(param[0], param[1])
      params_string = quote(params_string[:-1], '')
      string = method + '&amp;' + quote(address, '') + '&amp;' + params_string
      raw = string.encode()
      decoder = (self.cons_secret + '&amp;').encode()
      hashed = hmac.new(decoder, raw, sha1)
      sign = quote(str(b64encode(hashed.digest()))[2:-1])
      return sign
  </pre></code></p>