HttpClientFactoryServiceCollectionExtensions.AddHttpClient Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Aşırı Yüklemeler
AddHttpClient(IServiceCollection)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollectionekler.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddHttpClient (services As IServiceCollection) As IServiceCollection
Parametreler
- services
- IServiceCollection
Döndürülenler
Şunlara uygulanır
AddHttpClient(IServiceCollection, String)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve adlandırılmış HttpClientbir yapılandırır.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name);
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddHttpClient (services As IServiceCollection, name As String) As IHttpClientBuilder
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
Varsayılan istemciyi yapılandırmak için ad olarak kullanın DefaultName .
Şunlara uygulanır
AddHttpClient(IServiceCollection, String, Action<IServiceProvider,HttpClient>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve adlandırılmış HttpClientbir yapılandırır.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient);
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddHttpClient (services As IServiceCollection, name As String, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
- configureClient
- Action<IServiceProvider,HttpClient>
yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
Varsayılan istemciyi yapılandırmak için ad olarak kullanın DefaultName .
Şunlara uygulanır
AddHttpClient(IServiceCollection, String, Action<HttpClient>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve adlandırılmış HttpClientbir yapılandırır.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<System.Net.Http.HttpClient> configureClient);
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddHttpClient (services As IServiceCollection, name As String, configureClient As Action(Of HttpClient)) As IHttpClientBuilder
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
- configureClient
- Action<HttpClient>
yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
Varsayılan istemciyi yapılandırmak için ad olarak kullanın DefaultName .
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,IServiceProvider,TImplementation>)
IHttpClientFactory öğesine ve ilgili hizmetlerini IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Func<System::Net::Http::HttpClient ^, IServiceProvider ^, TImplementation> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Func<System.Net.Http.HttpClient,IServiceProvider,TImplementation> factory) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Func<System.Net.Http.HttpClient, IServiceProvider, #'Client> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String, factory As Func(Of HttpClient, IServiceProvider, TImplementation)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür, hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü belirtilen istemcinin uygulama türü.
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
- factory
- Func<HttpClient,IServiceProvider,TImplementation>
örneğini TClient
oluşturmak için kullanılan bir temsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient ile yapılandırılmış örnekler hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<HttpClient>)
IHttpClientFactory öğesine ve ilgili hizmetlerini IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<System.Net.Http.HttpClient> configureClient) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String, configureClient As Action(Of HttpClient)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür, hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü yazılan istemcinin uygulama türü. Belirtilen tür tarafından ITypedHttpClientFactory<TClient>örneği oluşturulacaktır.
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
- configureClient
- Action<HttpClient>
yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient ile yapılandırılmış örnekler hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Varsayılan istemciyi yapılandırmak için ad olarak kullanın DefaultName .
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü yazılan istemcinin uygulama türü. Belirtilen tür tarafından ITypedHttpClientFactory<TClient>örneği oluşturulacaktır.
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
- configureClient
- Action<IServiceProvider,HttpClient>
bir yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Varsayılan istemciyi yapılandırmak için ad olarak kullanın DefaultName .
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection, String)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır. İstemci adı türüne TClient
ayarlanır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü yazılan istemcinin uygulama türü. Belirtilen tür tarafından ITypedHttpClientFactory<TClient>örneği oluşturulacaktır.
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Varsayılan istemciyi yapılandırmak için ad olarak kullanın DefaultName .
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,TImplementation>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<System::Net::Http::HttpClient ^, TImplementation> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<System.Net.Http.HttpClient,TImplementation> factory) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<System.Net.Http.HttpClient, #'Client> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, factory As Func(Of HttpClient, TImplementation)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü yazılan istemcinin uygulama türü.
Parametreler
- services
- IServiceCollection
- factory
- Func<HttpClient,TImplementation>
örneğini TClient
oluşturmak için kullanılan bir temsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,IServiceProvider,TImplementation>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<System::Net::Http::HttpClient ^, IServiceProvider ^, TImplementation> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<System.Net.Http.HttpClient,IServiceProvider,TImplementation> factory) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<System.Net.Http.HttpClient, IServiceProvider, #'Client> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, factory As Func(Of HttpClient, IServiceProvider, TImplementation)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü yazılan istemcinin uygulama türü.
Parametreler
- services
- IServiceCollection
- factory
- Func<HttpClient,IServiceProvider,TImplementation>
örneğini TClient
oluşturmak için kullanılan bir temsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<HttpClient>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır. İstemci adı türüne TClient
ayarlanır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<System.Net.Http.HttpClient> configureClient) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, configureClient As Action(Of HttpClient)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü yazılan istemcinin uygulama türü. Belirtilen tür tarafından ITypedHttpClientFactory<TClient>örneği oluşturulacaktır.
Parametreler
- services
- IServiceCollection
- configureClient
- Action<HttpClient>
bir yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır. İstemci adı türüne TClient
ayarlanır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü yazılan istemcinin uygulama türü. Belirtilen tür tarafından ITypedHttpClientFactory<TClient>örneği oluşturulacaktır.
Parametreler
- services
- IServiceCollection
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,TImplementation>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Func<System::Net::Http::HttpClient ^, TImplementation> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Func<System.Net.Http.HttpClient,TImplementation> factory) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Func<System.Net.Http.HttpClient, #'Client> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String, factory As Func(Of HttpClient, TImplementation)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü yazılan istemcinin uygulama türü.
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
- factory
- Func<HttpClient,TImplementation>
örneğini TClient
oluşturmak için kullanılan bir temsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<IServiceProvider,HttpClient>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır. İstemci adı türüne TClient
ayarlanır.
public:
generic <typename TClient, typename TImplementation>
where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
- TImplementation
Türü yazılan istemcinin uygulama türü. Belirtilen tür tarafından ITypedHttpClientFactory<TClient>örneği oluşturulacaktır.
Parametreler
- services
- IServiceCollection
- configureClient
- Action<IServiceProvider,HttpClient>
bir yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
AddHttpClient<TClient>(IServiceCollection, String, Action<HttpClient>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır.
public:
generic <typename TClient>
where TClient : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<System.Net.Http.HttpClient> configureClient) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, name As String, configureClient As Action(Of HttpClient)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
- configureClient
- Action<HttpClient>
bir yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Varsayılan istemciyi yapılandırmak için ad olarak kullanın DefaultName .
Şunlara uygulanır
AddHttpClient<TClient>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır.
public:
generic <typename TClient>
where TClient : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, name As String, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
- configureClient
- Action<IServiceProvider,HttpClient>
bir yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Varsayılan istemciyi yapılandırmak için ad olarak kullanın DefaultName .
Şunlara uygulanır
AddHttpClient<TClient>(IServiceCollection, String)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır.
public:
generic <typename TClient>
where TClient : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, name As String) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
Parametreler
- services
- IServiceCollection
- name
- String
Yapılandırılan öğesinin HttpClient mantıksal adı.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Varsayılan istemciyi yapılandırmak için ad olarak kullanın DefaultName .
Şunlara uygulanır
AddHttpClient<TClient>(IServiceCollection, Action<HttpClient>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır. İstemci adı türüne TClient
ayarlanır.
public:
generic <typename TClient>
where TClient : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<System.Net.Http.HttpClient> configureClient) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, configureClient As Action(Of HttpClient)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
Parametreler
- services
- IServiceCollection
- configureClient
- Action<HttpClient>
bir yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
AddHttpClient<TClient>(IServiceCollection, Action<IServiceProvider,HttpClient>)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır. İstemci adı türüne TClient
ayarlanır.
public:
generic <typename TClient>
where TClient : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
Parametreler
- services
- IServiceCollection
- configureClient
- Action<IServiceProvider,HttpClient>
bir yapılandırmak için kullanılan bir HttpClienttemsilci.
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
AddHttpClient<TClient>(IServiceCollection)
IHttpClientFactory ve ilgili hizmetlerini öğesine IServiceCollection ekler ve türü ile adlandırılmış HttpClientbir arasında TClient
bir bağlama yapılandırır. İstemci adı tam adı TClient
olarak ayarlanır.
public:
generic <typename TClient>
where TClient : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection) As IHttpClientBuilder
Tür Parametreleri
- TClient
Yazılan istemcinin türü. Belirtilen tür hizmet koleksiyonuna geçici bir hizmet olarak kaydedilir. Yazılan istemcileri yazma hakkında daha fazla ayrıntı için bkz ITypedHttpClientFactory<TClient> .
Parametreler
- services
- IServiceCollection
Döndürülenler
IHttpClientBuilder İstemciyi yapılandırmak için kullanılabilecek bir.
Açıklamalar
HttpClient sağlanan yapılandırmayı uygulayan örnekler, eşleşen ad kullanılarak CreateClient(String) ve sağlanarak alınabilir.
TClient
uygun HttpClient şekilde yapılandırılmış örnekler, hizmet türü olarak sağlanarak TClient
(ve ilgili yöntemlerden GetService(Type) ) alınabilir.
Şunlara uygulanır
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin