public async Task <string> CreateAsync(CharacterCreateDTO character) { var response = await _client.PostAsync("api/characters", character.ToHttpContent()); if (response.IsSuccessStatusCode) { return(response.Headers.GetValues("Location").First()); } return(null); }
public async Task <int> CreateAsync(CharacterCreateDTO character) { var response = await _client.PostAsync("api/characters", character.ToHttpContent()); if (response.IsSuccessStatusCode) { var location = response.Headers.GetValues("Location").First(); return(int.Parse(location.Split('/').Last())); } return(-1); }