예제 #1
0
파일: Form1.cs 프로젝트: mmgenius/tpRest
        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);
        }