/// <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; } }