C#中的API调用(CsCart)

时间:2016-12-20 19:26:00

标签: c# api

我正在尝试通过C#调用API,但是我收到的错误是我的字符串不是URI。

string url = "@http://api@myAddress.com:API_KEY@myAddress.com/api.php?_d=products&ajax_custom=1";
            WebRequest webRequest = WebRequest.Create(url);
            WebResponse webResp = webRequest.GetResponse();
            return webResp.ToString();

我把请求放在地址栏中时效果很好......

1 个答案:

答案 0 :(得分:2)

将@移出字符串文字:

ref.label