Connectster.Shopify.ShopifyCommunicator.CreateProduct C# (CSharp) Method

CreateProduct() public method

public CreateProduct ( ShopifyStoreAuth storeAuth, IShopifyProduct sP ) : ShopifyResponse
storeAuth ShopifyStoreAuth
sP IShopifyProduct
return ShopifyResponse
        public ShopifyResponse<ShopifyProduct> CreateProduct(ShopifyStoreAuth storeAuth, IShopifyProduct sP)
        {
            //We serialize the ShopifyProduct into and XMLDocument, then POST it to shopify.
            var xS = new XmlSerializer(typeof (ShopifyProduct));

            var memStream = new MemoryStream();
            var xDoc = new XmlDocument();

            xS.Serialize(memStream, sP);
            memStream.Seek(0, SeekOrigin.Begin);
            xDoc.Load(memStream);
            memStream.Close();
            return
                new ShopifyResponse<ShopifyProduct>(
                    ShopifyPutPost((_protocol + storeAuth.StoreSubDomain + _domain + "/admin/products.xml"),
                                   HashString(_appAuth.Secret + storeAuth.StoreAuthToken), xDoc, "POST"));
        }