public string PutSku(string token, string sku)
        {
            var request = CreateRequest("/rest/V1/products/" + sku, Method.PUT, token);

            var m2product = new M2Product()
            {
                product = new Product()
                {
                    price = 777
                }
            };

            string json = JsonConvert.SerializeObject(m2product, Formatting.Indented);

            request.AddParameter("application/json", json, ParameterType.RequestBody);

            var response = Client.Execute(request);

            if (response.StatusCode == System.Net.HttpStatusCode.OK)
            {
                return(response.Content);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public void GetSku(string token, string sku)
        {
            var request = CreateRequest("/rest/V1/products/" + sku, Method.GET, token);

            var response = Client.Execute(request);

            if (response.StatusCode == System.Net.HttpStatusCode.OK)
            {
                M2Product product = JsonConvert.DeserializeObject <M2Product>(response.Content);
            }
        }