#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    10
    Rep Power
    0

    Help with python POST


    Hello,

    I am trying to get the following in python.

    curl http://www.site.com/oauth/token -d "client_secret=xxxxx&client_id=yyyyy&grant_type="client_credentials"

    it should return {"access_token":aaaaaaa, etc, etc, etc}

    the site is using oauth however I am wanting to do this without oauth if possible. the site does this in POST and not GET

    TIA for the help
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    10
    Rep Power
    0
    actually i found the solution.

    Code:
    import urllib
    
    data=urllib.urlencode({'grant_type': "xxxxx", 'client_id': "yyyyy", 'client_secret': "zzzzz"})
    f=urllib.urlopen("http://site.com/oauth/token", data)
    
    print f.read()

IMN logo majestic logo threadwatch logo seochat tools logo