public TeamCityClient(TeamCityClientOptions options) : this() { var handler = new HttpClientHandler { Credentials = new NetworkCredential(options.Username, options.Password), PreAuthenticate = true }; _httpClient = new HttpClient(handler) { BaseAddress = options.ServerUri }; _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(options.DefaultAcceptHeaderValue)); _httpClient.DefaultRequestHeaders.Add("Origin", options.ServerUri.AbsoluteUri); Projects = new ProjectsClient(_httpClient); BuildTypes = new BuildTypesClient(_httpClient); }
public TeamCityClient(HttpClient httpClient) : this() { _httpClient = httpClient; Projects = new ProjectsClient(_httpClient); BuildTypes = new BuildTypesClient(_httpClient); }