Hi guys,

I have a code that sends sms through clickatell gateway, but now I am getting the NotSupportedException with the message "this stream does not support seek operations". Anyone who has used clickatell gateway for sms successfully please help me.

Please help me eliminate this exception and get my code working.
here is my code:

client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR" +
                "1.0.3705;)");
              
                client.QueryString.Add("user", "*****");
                client.QueryString.Add("password", "******");
                client.QueryString.Add("api_id", "******");
                client.QueryString.Add("to", sms);
                client.QueryString.Add("text", "A new tender is uploaded, visit our website");
                string baseurl = "http://api.clickatell.com/http/sendmsg";
                System.IO.Stream data = client.OpenRead(baseurl); //I get the exception after this line
                
                System.IO.StreamReader reader = new System.IO.StreamReader(data);
                string s = reader.ReadToEnd();
                //data.Close();
                //reader.Close();
                return ;

Thanks,:confused:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.