문제

I used this library to make API requests and got the access tokens successfully.

But the documentation does not explain how _access_token and _access_token_secret should be used afterwards future. I suppose that there should be a method like:

set_access_token(_access_token, _access_token_secret)

but I could't find a method like that in this code or documentation.

Please help me to solve this problem.

도움이 되었습니까?

해결책

I have not used this particular library or API, but a common pattern in these cases is that you pass the token as an argument to subsequent calls. Looking at the source, I can see a function called get_user_profile in __init__.py:

def get_user_profile(self, access_token, selectors=None, headers=None, **kwargs):
    """
    Get a user profile.  If keyword argument "id" is not supplied, this
    returns the current user's profile, else it will return the profile of
    the user whose id is specificed.  The "selectors" keyword argument takes
    a list of LinkedIn compatible field selectors.
    """

So I'd guess you just want to pass the token as the first argument (in this instance).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top