예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 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));
 }