【发布时间】:2020-05-22 07:40:52
【问题描述】:
我被困在 ebay 的 getCateogory api 调用中,下面给出的是一个 django 视图,它在单击按钮时执行,我在 api 调用的后端获得了所需的输出,但它只是在 print(result) 上返回 <ebaysdk.response.Response object at 0x00FC6030> 的响应,如何在变量中获取有关此 API 调用的数据,以便将其作为上下文传递并以所需格式在前端使用。
基本上,我正在开发一个应用程序来执行 ebay 中的修改操作,因此希望按照 ebay 提供的方式自动填充其所有下拉列表,例如,项目条件字段应自动填充 ebay 的所有有效下拉选项支持和提供。这样我就不必在每次 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)
【问题讨论】:
标签: python django ebay-api ebay-sdk