Пример #1
0
        static async Task <Utilisateurs> GetProductAsync(string path)
        {
            Utilisateurs        product  = null;
            HttpResponseMessage response = await client.GetAsync(path);

            if (response.IsSuccessStatusCode)
            {
                product = await response.Content.ReadAsAsync <Utilisateurs>();
            }
            return(product);
        }
Пример #2
0
        public async Task <Uri> CreateUtilisateurAsync(Utilisateurs user)
        {
            var stringContent = new StringContent(user.toXML());

            HttpResponseMessage response = await m_client.PostAsync(
                "/mavenprojecttest/REST/utilisateur/create", stringContent);

            response.EnsureSuccessStatusCode();

            // return URI of the created resource.
            return(response.Headers.Location);
        }