public async Task <bool> DeletaMatchAsync(long idTournament, Match m) { var wc = new AuthHttpClient(); try { var response = await wc.DeleteAsync(await ApiAccess.GetRessource(ApiAccess.URL.MATCHS, idTournament, m.Id)); GetResponseService.TraiteResponse(response, null, false); return(true); } catch (HttpRequestException) { throw new GetDataException(); } }
public async Task <bool> DelPointMatch(long id, Point point) { HttpContent putContent = new StringContent(JObject.FromObject(point).ToString()); putContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); var wc = new AuthHttpClient(); try { var response = await wc.DeleteAsync(await ApiAccess.GetRessource(ApiAccess.URL.POINTS, id, point.Joueur)); GetResponseService.HandleResponse(response, null, false); return(true); } catch (HttpRequestException) { throw new GetDataException(); } }
public async Task <ResponseObject> DelPointMatch(long id, Point point) { HttpContent putContent = new StringContent(JObject.FromObject(point).ToString()); putContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); var wc = new AuthHttpClient(); var response = await wc.DeleteAsync(ApiAccess.GetMatchPointUrl(id) + "/" + point.Joueur); ResponseObject contentResponse = new ResponseObject(); String jstr = response.Content.ReadAsStringAsync().Result; if (response.StatusCode == HttpStatusCode.Accepted) { contentResponse.Content = JObject.Parse(jstr); contentResponse.Success = true; } else { contentResponse.Content = JArray.Parse(jstr); contentResponse.Success = false; } return(contentResponse); }