internal async Task <bool> EditAnswersAsync(Modell.ChallengeObjects.Answers param) { string json = await Task.Run(() => JsonConvert.SerializeObject(param)); HttpContent content = new StringContent(json, Encoding.UTF8, "application/json"); HttpResponseMessage result = await _httpClient.PutAsync(new Uri(answersBaseUri, param.AnswersID.ToString()), content); return(result.IsSuccessStatusCode); }
public async Task <Modell.ChallengeObjects.Answers> CreateAnswersAsync(Modell.ChallengeObjects.Answers param) { string json = await Task.Run(() => JsonConvert.SerializeObject(param)); HttpContent content = new StringContent(json, Encoding.UTF8, "application/json"); HttpResponseMessage result = await _httpClient.PostAsync(answersBaseUri, content); param.AnswersID = int.Parse(result.Headers.Location.Segments.Last()); return(param); }