Skip to content

Instantly share code, notes, and snippets.

@otiai10
Last active December 20, 2015 03:09
Show Gist options
  • Save otiai10/6061908 to your computer and use it in GitHub Desktop.
Save otiai10/6061908 to your computer and use it in GitHub Desktop.
~/.pyenv/versions/tool13.0721/lib/python3.3/site-packages/twitter/api.py
        uriBase = "http%s://%s/%s%s%s" %(
                    secure_str, self.domain, uri, dot, self.format)
        print('HERERERERERRERERRERER')
        print('secure_str', secure_str)
        print('self.domain', self.domain)
        print('uri', uri)
        print('dot', dot)
        print('format', self.format)
        print(uriBase)

        headers = {'Accept-Encoding': 'gzip'}
        if self.auth:
            headers.update(self.auth.generate_headers())
            arg_data = self.auth.encode_params(uriBase, method, kwargs)
            if method == 'GET':
                uriBase += '?' + arg_data
                body = None
            else:
                body = arg_data.encode('utf8')

        req = urllib_request.Request(uriBase, body, headers)
        return self._handle_response(req, uri, arg_data, _timeout)

res

secure_str s
self.domain api.twitter.com
uri 1.1/friendships/create/140021552
dot .
format json
https://api.twitter.com/1.1/friendships/create/140021552.json

but in correct

POST        
https://api.twitter.com/1/friendships/create.json
POST Data        
user_id=1401881
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment