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

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

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

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

            var deleteResponse = await httpClientGen7.DeleteAsync <BookResponse>(new Uri($"/api/books/{postResponse.Id}", UriKind.Relative));
        }
Beispiel #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;
 }