[英]GetCategories ebay API call in django
i am stuck in getCateogory api call of ebay, given below is a django view which executes on a button click, i am getting desired output in backend on api call but it just returns a response as <ebaysdk.response.Response object at 0x00FC6030>
在print(result)
上,如何在变量中获取有关此 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)
要查看 ebay 的 XML 响应的文本,请执行以下操作: print(result.content) 或 print(result.dict()) 将其视为字典。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.