在shopify中发布产品系列

时间:2020-08-11 19:06:06

标签: c# shopify shopify-api

尝试使用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);

0 个答案:

没有答案
相关问题