3

我正在尝试借助post方法在 Airtable 上创建一个新表。我有以下代码:

# importing the requests library 
import requests 

# defining the api-endpoint 
API_ENDPOINT = "https://api.airtable.com/v0/appa3r2UUo4JxpjSv/Table%201?api_key=MYKEY"


# data to be sent to api 
data =  {
   'fields': {
        'Name': 'Andromachis Row'
    } 

} 

# sending post request and saving response as response object 
r = requests.post(url = API_ENDPOINT, data = data)

# extracting response text 
print(r.text)

尽管如此,当我运行脚本时,我收到一条错误消息:

(mypyth) PS C:\Users\andri\PythonProjects\mypyth> py post_API.py
{"error":{"type":"INVALID_REQUEST_UNKNOWN","message":"Invalid request: parameter validation failed. Check your request data."}}

有谁明白为什么会这样?我真的很绝望!提前致谢

4

0 回答 0