我在使用Azure网络应用程序从Shopify下载JSON时遇到了一些问题 .
以下代码在我的本地应用程序上运行得非常好 . 但是,当我在Azure上发布它时,它不起作用,给我“不支持给定路径的格式”错误 .
public ActionResult UpdateStore()
{
string APIUrl = "https://" + objStore.ApiKey + ":" + objStore.ApiPassword + "@" + objStore.Name + ".myshopify.com/admin/custom_collections.json";
using (var webClient = new WebClient())
{
webClient.UseDefaultCredentials = true;
webClient.Credentials = new NetworkCredential(objStore.ApiKey, objStore.ApiPassword);
var htmlResult = webClient.DownloadString(APIUrl);
}
return View();
}
Shopify URL格式通过私有应用访问商店信息是https://apikey:password@hostname/admin/resource.json
我在网上看了很多,找不到解决这个问题的方法 . 非常感谢任何帮助!