I am trying access my CloudFoundry
apps in python and i am using requests
module.
First I have tried
import requests
response=requests.get("https://api.run.pivotal.io")
It is showing UnAuthorized error. for my knowledge First we have to get the token from authentication server. so I have used
response=requests.get('https://login.run.pivotal.io',auth=('username','pwd'))
It is successfull and getting response code 200. my doubt is how to get my apps data. I am trying
response=requests.get("https://api.run.pivotal.io/v2/apps",'Authorization':'access_token myToken')
but still getting UnAuthorized error. How to give access token
in headers, because login url is different so that i am not able to access that.
access_token
from one url and data from another url. To get data I have to giveaccess_token
to second url