Example #1
0
        private async Task TestClient6(HttpClientGen6 httpClientGen6, string title, string author)
        {
            var postResponse = await httpClientGen6.PostAsync <BookPostRequest, BookResponse>(
                new Uri("/api/books", UriKind.Relative),
                new BookPostRequest
            {
                Title  = title,
                Author = author
            });

            await httpClientGen6.PutAsync(
                new Uri($"/api/books/{postResponse.Id}", UriKind.Relative),
                new BookPutRequest
            {
                Id     = postResponse.Id,
                Title  = $"{title} - updated",
                Author = $"{author} - updated"
            });

            var getResponse = await httpClientGen6.GetAsync <BookResponse>(new Uri($"/api/books/{postResponse.Id}", UriKind.Relative));

            var getListResponse = await httpClientGen6.GetAsync <IEnumerable <BookResponse> >(new Uri("/api/books", UriKind.Relative));

            var deleteResponse = await httpClientGen6.DeleteAsync <BookResponse>(new Uri($"/api/books/{postResponse.Id}", UriKind.Relative));
        }
Example #2
0
 public Startup(
     HttpClientGen1 httpClientGen1, HttpClientGen2 httpClientGen2, HttpClientGen3 httpClientGen3, HttpClientGen4 httpClientGen4,
     HttpClientGen5 httpClientGen5, HttpClientGen6 httpClientGen6, HttpClientGen7 httpClientGen7, HttpClientGen8 httpClientGen8)
 {
     _httpClientGen1 = httpClientGen1;
     _httpClientGen2 = httpClientGen2;
     _httpClientGen3 = httpClientGen3;
     _httpClientGen4 = httpClientGen4;
     _httpClientGen5 = httpClientGen5;
     _httpClientGen6 = httpClientGen6;
     _httpClientGen7 = httpClientGen7;
     _httpClientGen8 = httpClientGen8;
 }