0

我正在尝试使用此 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)
4

1 回答 1

0

根据 Folio Note Trading API 手册(1/22/2018):

支持的格式:CSV

对于 Listings GET 调用,您必须包含 Accept: text/csv 标头并排除 Content-Type 标头

将标题更改为此有效:

headers = {
    'Accept': "text/csv",
    'Authorization': lc_apikey,
    'X-LC-Application-Key': lc_InvestorId
    }
于 2019-06-30T02:31:37.957 回答