2021年2月4日星期四

Python3 - Get Request with Secret

I am trying to send a get request to Airtable to get metadata but I keep getting errors.

I have tried the below.

base_schema_url = 'https://api.airtable.com/v0/meta/bases/BaseId(replaced this)/tables'  secret_meta_token = '123'    #attempt 1  r = requests.get(base_schema_url, headers={'Authorization': secret_meta_token})  print(r.text)    #attempt 2  r = requests.get(base_schema_url,        headers={'Content-Type':'application/json',                 'Authorization': 'Bearer {}'.format(secret_meta_token)})  print(r.text)    #attempt 3  header = {'PRIVATE-TOKEN': secret_meta_token}  r = requests.get(base_schema_url, headers=header)  print(r.text)    

I have a feeling it's because I need to pass in the user API + the Meta token but I'm not too sure how to do it.

https://stackoverflow.com/questions/66056598/python3-get-request-with-secret February 05, 2021 at 10:06AM

没有评论:

发表评论