putRequestAsync() публичный статический Метод

Async: Make an HTTP PUT request to a URL with data
public static putRequestAsync ( string url, string putData ) : Task
url string The URL you would like to send a request to.
putData string The data you would like to send to the URL (e.g. JSON)
Результат Task
Пример #1
0
        /// <summary>
        /// Upload a new document to Couch.
        /// </summary>
        /// <param name="json">The JSON to upload as a new document</param>
        /// <param name="id">The ID of the new document</param>
        public async void uploadDocument(string json, string id = "")
        {
            if (!NetworkInterface.GetIsNetworkAvailable())
            {
                _status = false; return;
            }

            if (id == "")
            {
                id = await getNewUUID();
            }

            string url = _databaseurl + _databasename + "/" + id;

            try
            {
                string result = await HTTPRequests.putRequestAsync(url, json);

                Dictionary <string, object> resultJSON = JsonConvert.DeserializeObject <Dictionary <string, object> >(result);
                _status = (bool)resultJSON["ok"];
            }
            catch { _status = false; }
        }