Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2012 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4325547 to your computer and use it in GitHub Desktop.
Save anonymous/4325547 to your computer and use it in GitHub Desktop.
Send new datapoints to COSM.com
var webClient = new WebClient();
webClient.Headers.Set("X-ApiKey", "KbI9MZtLvhaOuAi0DKXWzc4UZk-SAKxhQjd3MHJtd2ZwYz0g");
var response = webClient.UploadString(
"http://api.cosm.com/v2/feeds/92158/datastreams/WaterLevel/datapoints",
"POST",
@"{
""datapoints"":[
{""at"":""2012-12-18T04:00:00Z"",""value"":""294""},
{""at"":""2012-12-18T04:01:00Z"",""value"":""295""},
{""at"":""2012-12-18T04:02:00Z"",""value"":""296""},
{""at"":""2012-12-18T04:03:00Z"",""value"":""350""}
]
}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment