c# - 在 shopify 中发布一系列产品
问题描述
尝试使用 c# httpClinet 发布产品数组进行购物。但收到 400 个错误请求。还尝试发布产品数组 = 新对象之类的项目,但也得到了 400 个代码。
var arrayOfProducts = new
{
products = new[]
{
new
{
title = "qqwqw",
description = "test",
product_type = "Game",
vendor = "test"
},
new
{
title = "1233eewq",
description = "test",
product_type = "Game",
vendor = "test"
}
}
};
var resp = await http.PostAsync($"{_shopify.Path}/products.json", new StringContent(
JsonSerializer.Serialize(arrayOfProducts)
, Encoding.UTF8, "application/json"), stoppingToken);
解决方案
推荐阅读
- python - 模型中自动生成的字段
- c# - Manatee.Json 获得人类可读的 SchemaValidationResults 输出
- r - 如何将 tibble 打印到具有良好格式的文本文件?
- angular - 在 AG 网格的单元格中双击编辑时更改列宽
- apache-spark - 在火花中,他们在附加新行时是否可以替代 union() 函数?
- django - Django:.count() 是否强制查询集评估
- reactjs - 如何根据选中的复选框(反应)切换按钮类名?
- angular - 如何强制在 Angular 中渲染相同的输入?
- aws-lambda - 在身份验证后 lambda 触发器中获取 AWS cognito 身份验证用户
- vb.net - 下周五和下第二个周一