我被困在易趣的getCateogory应用程序接口调用,下面是一个django视图,这是一个按钮点击执行,我得到了想要的输出在后端的应用程序接口调用,但它只是返回一个响应作为print(result)
上的<ebaysdk.response.Response object at 0x00FC6030>
,如何获得这个api调用的数据在一个变量中,以便它可以作为一个上下文传递,并可以在前端使用所需的格式。
基本上,我正在开发一个应用程序来执行修订操作,如在易趣,所以想要填写它的所有下拉自动由易趣提供,例如,项目条件字段应自动填充所有有效的下拉选项,易趣支持和提供。这样我就不必在每次ebay添加新的商品条件时手动更改它。如果有什么办法,请告诉我。
path = rootpath.detect()
print(path)
path = (path + "\\listing\\ebay.yaml")
api = Connection(config_file=path, domain="api.sandbox.ebay.com", debug=True)
GetCategoriesRequest = {
"RequesterCredentials": {
"eBayAuthToken": "xyz",
},
"CategorySiteID": "0",
"DetailLevel": "ReturnAll",
"LevelLimit": "1",
}
result = api.execute("GetCategories", GetCategoriesRequest)
print("response of getcategories function is: ")
print(result)
print("get Category function worked!")
ctx = {
'result': result
}
return render(request, 'listing/reviseProduct.html', ctx)
发布于 2020-07-13 01:15:04
要查看ebay的XML响应的文本,请执行以下命令: print(result.content)或print(result.dict())以字典形式查看它。
https://stackoverflow.com/questions/61950025
复制相似问题