我正在尝试使用 python 与存储在 back4app 中的数据库进行交互。发送我的 GET 请求后,我收到“{'message': 'Not Found', 'error': {}}”。我的python代码如下:
import json, http.client, urllib.parse
# create a connection to the server
url = "parseapi.back4app.com"
connection = http.client.HTTPSConnection(url)
connection.connect()
# define parameter for GET request
params = urllib.parse.urlencode({"where":json.dumps({"Name": "Dru Love"})})
# perform GET request
connection.request('GET', '/parse/classes/PGA?%s' % params, '', {
"X-Parse-Application-Id": "app_id",
"X-Parse-REST-API-Key": "api_key"
})
# store response in result variable
result = json.loads(connection.getresponse().read())
connection.close()
print(result)
回复:
{'message': 'Not Found', 'error': {}}