Skip to content

Instantly share code, notes, and snippets.

@clemensv
Created May 3, 2012 21:12
Show Gist options
  • Save clemensv/2589551 to your computer and use it in GitHub Desktop.
Save clemensv/2589551 to your computer and use it in GitHub Desktop.
I actually wasn't kidding about entityless HTTP calls
var wr = WebRequest.Create("http://localhost:39472/Provisioning.svc/setup");
wr.Method = "POST";
wr.Headers.Add("P-DeviceId", this.deviceId);
using (var wq = (HttpWebResponse)wr.GetResponse())
{
if (wq.StatusCode == HttpStatusCode.OK)
{
settings.DeviceAccount = wq.Headers["P-DeviceAccount"];
settings.DeviceKey = wq.Headers["P-DeviceKey"];
settings.DeviceSubscriptionUri = new Uri(wq.Headers["P-DeviceSubscriptionUri"]);
settings.EventSubmissionUri = new Uri(wq.Headers["P-EventSubmissionUri"]);
[...]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment