lundi 6 août 2018

Xamarin Form - is it possible to use string as a content in consuming POST method?

i created a string where i put a json string like this

 string tester = "{\"res_no\":\"1\",\"mem_account_no\":\"1\",\"res_name\":\"test\",\"res_num_of_persons\":\"5\",\"res_arrival_date\":\"2018 - 05 - 05\",\"res_arrival_time\":\"00:00:00\",\"res_note\":\"test\",\"mem_fname\":\"test\",\"custom_package\":\"test\",\"mem_mobile_no\":\"09129609612\"}";

and i want to directly use it as a content for PostAsync

 HttpClient client = new HttpClient();

            var result = await client.PostAsync("test.com/potangina/final/Restserver/index.php/reservation/insert_reservation",tester ); // tester is highlighted as error

is there any way to make it possible? i need it to test my app because SerializeObject doesn't work in live player.




Aucun commentaire:

Enregistrer un commentaire