Created
December 10, 2013 10:32
-
-
Save salimkayabasi/7888642 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 uri = "http://api.easysocket.io"; | |
//Do not forget to assign your private key | |
String privateKey=""; | |
String parameters ="privateKey="+privateKey+"data=Hello World!"; | |
var req = WebRequest.Create(uri); | |
req.ContentType = "application/x-www-form-urlencoded"; | |
req.Method = "POST"; | |
var bytes = Encoding.ASCII.GetBytes(parameters); | |
req.ContentLength = bytes.Length; | |
var os = req.GetRequestStream(); | |
os.Write(bytes, 0, bytes.Length); | |
os.Close(); | |
var resp = req.GetResponse(); | |
var sr = new System.IO.StreamReader(resp.GetResponseStream()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment