【发布时间】:2021-11-16 08:00:50
【问题描述】:
我想使用 Shopify Python API 获取产品列表并以 JSON 格式返回。 我尝试了 .to_json() 函数
products=shopify.Product.find().to_json()
得到错误
'PaginatedCollection' object has no attribute 'to_json'
我试过了
products=shopify.Product.find()
js=json.dumps(products)
错误:
Object of type Product is not JSON serializable
如何将 Products 响应序列化为 JSON?
【问题讨论】:
标签: python json serialization shopify shopify-app