Esempio n. 1
0
        protected async void btnInsert_Click(object sender, EventArgs e)
        {
            if (Page.IsValid) { 
                HttpClient httpClient = new HttpClient();

                httpClient.BaseAddress = new Uri(ip);
                Models.Restaurante f = new Models.Restaurante
                {
                    Descricao = textBoxDesc.Text
                };
           
                string s = JsonConvert.SerializeObject(f);

                var content = new StringContent(s, Encoding.UTF8, "application/json");

                await httpClient.PostAsync("/20131011110061/api/restaurante", content);

                Reload();
            }
        }
Esempio n. 2
0
 public UsuarioSistema ComRestaurante(Restaurante r)
 {
     this.restaurante = r;
     return this;
 }