Created
January 31, 2011 16:53
-
-
Save zircote/804353 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string cUrl = "https://{CVAccountName}.cloudvox.com/api/v1/applications/{CVAppID}/sms"; | |
HttpWebRequest webClient = (HttpWebRequest) WebRequest.Create(cUrl); | |
// *** Send any POST data | |
string postData = "to={to}&from={CVPhoneNumber}&message={message}"; | |
webClient.Method="POST"; | |
byte [] postBuffer = System.Text.Encoding.GetEncoding(1252).GetBytes(postData); | |
webClient.ContentLength = postBuffer.Length; | |
webClient.Credentials = new System.Net.NetworkCredential(myusername, mypassword); | |
Stream loPostData = webClient.GetRequestStream(); | |
loPostData.Write(postBuffer,0,postBuffer.Length); | |
loPostData.Close(); | |
HttpWebResponse webResponse = (HttpWebResponse) webClient.GetResponse(); | |
Encoding enc = System.Text.Encoding.GetEncoding(1252); | |
StreamReader responseStream = new StreamReader(webResponse.GetResponseStream(),enc); | |
string html = responseStream.ReadToEnd(); | |
webResponse.Close(); | |
responseStream.Close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment