Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

Boris Zeiberg commented on Private app API URL works in browser but not in API call.

$
0
0

I have the same issue with .NET client. JSON call is fine in FireFox using RestClient but not in .NET app. I get The remote server returned an error: (401) Unauthorized.

Any suggestions?

https://xxxx:xxxx@themountaintestsite.myshopify.com/admin/orders.json

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUrl);
            request.ContentType = "application/json; charset=utf-8";
            request.Accept = "application/json";
            request.Method = WebRequestMethods.Http.Get;
            request.KeepAlive = true;

            try {
                var response = (HttpWebResponse)request.GetResponse();
                using (Stream responseStream = response.GetResponseStream()) {
                    StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
                    return reader.ReadToEnd();
                }
            }

 


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>