async public void PostMapObject(MapObjects mo) { string json = JsonConvert.SerializeObject(mo); var stringContent = new StringContent(json, Encoding.UTF8, "application/json"); var response = await httpClient.PostAsync(url, stringContent); string result = response.Content.ToString(); }
public void CreateTestObject(string region) { MapObjects mo = new MapObjects(); mo.Lat = 47.6750829m; mo.Lon = -122.1140707m; mo.Type = "monster"; mo.Region = region; mo.AttributesDict = new Dictionary <string, string>(); mo.AttributesDict.Add("name", "rat"); mo.AttributesDict.Add("hitpoints", "100"); mo.TimeStamp = DateTime.UtcNow; PostMapObject(mo); }