首页 > 解决方案 > 在 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);

标签: c#shopifyshopify-api

解决方案


推荐阅读