public HttpResponseMessage GetIps() { Console.WriteLine("WhatIsMyIp called"); var output = Request.GetClientIpAddress(); PublicObjects.KV kvobject = new PublicObjects.KV { Key = "IP", Value = output }; JObject ob = (JObject)JToken.FromObject(kvobject); return Request.CreateResponse(HttpStatusCode.OK, ob); }
public HttpResponseMessage GetHostName() { Console.WriteLine("WhereIsHortlak called"); PublicObjects.KV kvobject = new PublicObjects.KV { Key = "Host", Value = Environment.MachineName }; JObject ob = (JObject) JToken.FromObject(kvobject); //JArray array = new JArray {ob}; //JObject o = new JObject(); //o["hosts"] = array; return Request.CreateResponse<JObject>(HttpStatusCode.OK, ob); }