22
1
using System;
2
using System.Net;
3
4
public class Program
5
{
6
public static void Main()
7
{
8
WebClient client = new WebClient();
9
var jsonString = "{\"IsEnabled\":true,\"Name\":\"ShorterText\",\"FeatureType\":\"Femah.Core.FeatureSwitchTypes.SimpleFeatureSwitch, Femah.Core, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null\",\"Description\":\"Define a short description of the feature switch type here.\",\"ConfigurationInstructions\":\"Add configuration context and instructions to be displayed in the admin UI\"}";
10
client.Headers.Add("Content-Type","application/json");
11
12
var jsonResponse = client.UploadString("http://femah-additionator.azurewebsites.net/femah.axd/api/featureswitches/ShorterText", "PUT", jsonString);
13
14
Console.WriteLine("--- JSON response ---");
15
Console.WriteLine(jsonResponse);
16
17
string contentType = client.ResponseHeaders["Content-Type"];
18
19
Console.WriteLine("--- Content-Type ---");
20
Console.WriteLine(contentType);
21
}
22
}
Cached Result
----- Auth3Type ----
value : 34
string : Opt1, Opt5
Auth3Type.Opt1 : True
Auth3Type.Opt2 : False
value : 34
string : Opt1, Opt5
Auth3Type.Opt1 : True
Auth3Type.Opt2 : False