با سلام
من از متد get برای دریافت داده ها از web api استفاده می کنم
چجوری می تونم از post استفاده نمایم؟
لطفا راهنمایی نمایید
با تشکر
public async Task SaveTodoItemAsync (TodoItem item, bool isNewItem = false) { // RestUrl = http://developer.xamarin.com:8081/api/todoitems/ var uri = new Uri (string.Format (Constants.RestUrl, string.Empty)); ... var json = JsonConvert.SerializeObject (item); var content = new StringContent (json, Encoding.UTF8, "application/json"); HttpResponseMessage response = null; if (isNewItem) { response = await client.PostAsync (uri, content); } ... if (response.IsSuccessStatusCode) { Debug.WriteLine (@" TodoItem successfully saved."); } ... }
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)