API调用未成功

问题描述 投票:0回答:1

大家好,

我正在尝试使用SMS API。从我的角度来看,一切都很好,但SMS没有发送。如果我直接在浏览器上使用URL,它将执行。

或者我如何构建字符串有什么问题?下面是代码。

请注意cbo.Title是一个comobox,txtFirstname是一个Textbox。

public void NewText()
    {

            string username = "[email protected]";
            string password = "Password";
            string urlStr;
            string message=" Dear  " + cbo_Title.Text + "  " + txt_FirstName.Text + ",  Your New Savings Account Number is " + Account_No + ".Welcome to AGENTKUNLE Global Services.  Your Future is Our Priority ";
            string sender = "AGENTKUNLE";
            string recipient=txt_Phone.Text;
           urlStr = "https://portal.nigeriabulksms.com/api/?username="+username+"+password="+password+"+sender="+sender+"+message="+message+"+ mobiles="+recipient;

            Uri success  = new Uri(urlStr);


    }
c# api sms
1个回答
0
投票

您从未提出请求。

Uri对象只是uri的容器(请参见Microsoft Docs)。如果要发送请求,请签出HttpClient类。

© www.soinside.com 2019 - 2024. All rights reserved.