Recently I’ve been putting together a POC in C# that uses a RESTfull service and while there are tons of examples on how to GET data back there is very little info on how to POST data, specially if you want to POST back JSON content.
So here is a simple example, note I’ve used JSON.NET and I’m making use of the dynamic variable only available in C# 4 and above.
using (var client = new HttpClient())
var request = new CreateAppRequest()
userAgent = "myAgent",
endpointId = "1234",
culture = "en-US"
var response = client.PostAsync("https://domain.com/CreateApp",
dynamic content = JsonConvert.DeserializeObject(
// Access variables from the returned JSON object
var appHref = content.links.applications.href;
Source: POSTing JsonObject With HttpClient From New REST API (preview release 4)
If you are looking for a quick and easy way to see how much code coverage you have with your unit tests in Visual Studio and to see areas of your code that you are missing visually. Here’s what to do:
Source: Using Code Coverage to Determine How Much Code is being Tested
Ran into this very frustrating issue of the missing DLL SIPEPS when doing some Lync development with the UCMA library.
Turns out your project needs to be set to x64 as a x86 version of the DLL does not exist in the GAC.
So in the properties of your application set the target platform to x64, problem solved.
Source: Error about SIPEPS DLL with UCMA 4.0