Here’s a little C# extension class that serializes a set of HttpHeaders as a JSON string: View the code on Gist. NOTE: It uses the JSON.NET library to do the actual serialization. For example, if you want to serialize Web API request (or response) headers, you might do something like this: var serializedHeaders = request.Headers.ToJson(); …
Month: September 2015
Extract Custom Header Value From Web API Request
Here’s a simple C# extension method that returns the value of a custom header from a Web API request; it extends the HttpRequestMessage class: View the code on Gist. Assuming you have a HttpRequestMessage object, you can call it as such: var customHeaderValue = request.GetHeaderValue("Custom-Header"); Enjoy. Featured Image: All rights reserved by asienman
Common Outputs for Windows SC Command
I’ve been doing a bit of work with Windows services lately, in particular automated deployments of Windows services, which means I’ve been using the Windows SC command a lot. The SC command (short for “Service Controller”, located at C:\Windows\System32\sc.exe) is a really easy tool used to query/install/uninstall/start/stop Windows services from the command line. And if …
.NET Framework 4.5.1 SDK
Anyone out there remember the Arsenio Hall Show? One of his trademark gags was where he would think about certain things and would refer to them as “things that make you go hmmm”. Trying to find the download for the .NET Framework 4.5.1 SDK is one of those things. For some unknown reason, Microsoft decided …