我正在尝试使用此Python代码来访问Folio API,以用于二级市场列表。类似的代码在Lending Club的主要列表中对我有用。这将返回错误代码[500],这是内部错误。
import requests
lc_InvestorId = "1111"
lc_apikey = "xxxx"
lc_module = 'secondarymarket/listings'
url = f"https://api.lendingclub.com/api/investor/v1/{lc_module}"
payload = {}
params = {'updatedSince':10000}
headers = {
'ContentType': "application/json",
'Accept': "application/json",
'Authorization': lc_apikey,
'X-LC-Application-Key': lc_InvestorId
}
response = requests.request("GET", url, data=payload, headers=headers, params=params)
答案 0 :(得分:0)
根据Folio Note Trading API手册(1/22/2018):
支持的格式:CSV
对于Listings GET调用,您必须包括 接受:text / csv标头,但不包含Content-Type标头
将标题更改为此有效
headers = {
'Accept': "text/csv",
'Authorization': lc_apikey,
'X-LC-Application-Key': lc_InvestorId
}