Ejemplo n.º 1
0
        public async Task PostUser()
        {
            var userToCreate = new CreateUser
            {
                Email       = "Oryx",
                FirstName   = "Anton",
                LastName    = "Tsvetanov",
                HouseholdId = 3
            };


            var requestContent = new StringContent(userToCreate.ToJson(), Encoding.UTF8, "application/json");

            var response = await _client.PostAsync($"/users", requestContent);

            var responseContent = await response.Content.ReadAsStringAsync();

            var actualUser = CreateUser.FromJson(responseContent);