public void SendTestObject(TestObjectJson toj) { // var client = new RestClient(values.BaseUrlMSFUEjemplo + FUControllers.CONTROLLER_MS_FU_EJEMPLO + "/object/{id}"); var request = new RestRequest(Method.POST); request.RequestFormat = DataFormat.Json; request.AddJsonBody(toj); var response = client.Execute(request.AddUrlSegment("id", 999)); System.Diagnostics.Debug.WriteLine(response.StatusCode); }
public void SendTestObject() { TestObjectJson toj = new TestObjectJson(); toj.ValorA = "IKKK"; toj.ValorB = 88888; toj.list = new List <TestObjectJsonItem>(); TestObjectJsonItem item = new TestObjectJsonItem(); item.Item2 = "otro item"; toj.list.Add(item); this.apiEjemplo.SendTestObject(toj); }
public IHttpActionResult GetJson2(int id, string value, TestObjectJson test) { System.Diagnostics.Debug.WriteLine("A " + test.ValorA); System.Diagnostics.Debug.WriteLine("B " + test.ValorB); return(Ok(test.ValorA)); }