Exemple #1
0
        private static async Task Put()
        {
            var model = new MovieInputModel
            {
                Id          = 4,
                Title       = "Thunderball-Put",
                ReleaseYear = 1965,
                Summary     = "James Bond heads to The Bahamas to recover two nuclear warheads stolen by SPECTRE agent Emilio Largo in an international extortion scheme."
            };

            var requestUri = $"{baseUri}/4";
            var response   = await HttpRequestFactory.Put(requestUri, model);

            Console.WriteLine($"Status: {response.StatusCode}");
        }
Exemple #2
0
        private static async Task Post()
        {
            var model = new MovieInputModel
            {
                Id          = 4,
                Title       = "Thunderball",
                ReleaseYear = 1965,
                Summary     = "James Bond heads to The Bahamas to recover two nuclear warheads stolen by SPECTRE agent Emilio Largo in an international extortion scheme."
            };

            var requestUri = $"{baseUri}";
            var response   = await HttpRequestFactory.Post(requestUri, model);

            Console.WriteLine($"Status: {response.StatusCode}");
            //Console.WriteLine(response.ContentAsString());
            var outputModel = response.ContentAsType <MovieOutputModel>();

            Console.WriteLine("{0} - {1}", outputModel.Id, outputModel.Title);
        }