尝试使用c#httpClinet发布产品数组进行购物。但是收到400个错误的请求。还尝试发布product = new对象(如商品)数组,但也获得了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);