Как читать данные shopify из веб-приложения C#
I need to write an integration for Shopify. Shopify is an ecommerce platform which lets you create an ecommerce website. So I have to write a c# code which pulls product information from a Shopify store. any example would be appreciated
Что я уже пробовал:
public string GetCustomers() { ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; const string Url = "https://fd49a55f3afafdff141b8ab40809516b:ccb2f6bfa@ausshirts99s34.myshopify.com/admin/orders.json"; var req = (HttpWebRequest)WebRequest.Create(Url); req.Method = "GET"; req.ContentType = "application/json"; req.Credentials = GetCredential(Url); req.PreAuthenticate = true; req.KeepAlive = false; // req.ProtocolVersion = HttpVersion.Version10; using (var resp = (HttpWebResponse)req.GetResponse()) { if (resp.StatusCode != HttpStatusCode.OK) { string message = String.Format("Call failed. Received HTTP {0}", resp.StatusCode); throw new ApplicationException(message); } var sr = new StreamReader(resp.GetResponseStream()); return sr.ReadToEnd(); } } private static CredentialCache GetCredential(string url) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; var credentialCache = new CredentialCache(); credentialCache.Add(new Uri(url), "Basic", new NetworkCredential("fd49a55f3afafd8ab40809516b", "ccb2e52e272c0c3f6bfa")); return credentialCache; } }