HttpClient-Klasse

Provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI.

Vererbungshierarchie

System.Object
  System.Net.Http.HttpMessageInvoker
    System.Net.Http.HttpClient

Namespace:  System.Net.Http
Assembly:  System.Net.Http (in System.Net.Http.dll)

Syntax

'Declaration
Public Class HttpClient _
    Inherits HttpMessageInvoker
'Usage
Dim instance As HttpClient
public class HttpClient : HttpMessageInvoker
public ref class HttpClient : public HttpMessageInvoker
type HttpClient =  
    class 
        inherit HttpMessageInvoker 
    end
public class HttpClient extends HttpMessageInvoker

Der HttpClient-Typ macht folgende Elemente verfügbar.

Konstruktoren

  Name Beschreibung
Öffentliche Methode HttpClient() Initializes a new instance of the HttpClient class.
Öffentliche Methode HttpClient(HttpMessageHandler) Initializes a new instance of the HttpClient class with a specific handler.
Öffentliche Methode HttpClient(HttpMessageHandler, Boolean)

Zum Anfang

Eigenschaften

  Name Beschreibung
Öffentliche Eigenschaft BaseAddress Gets or sets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests.
Öffentliche Eigenschaft DefaultRequestHeaders Gets the headers which should be sent with each request.
Öffentliche Eigenschaft MaxResponseContentBufferSize Gets or sets the maximum number of bytes to buffer when reading the response content.
Öffentliche Eigenschaft Timeout Gets or sets the number of milliseconds to wait before the request times out.

Zum Anfang

Methoden

  Name Beschreibung
Öffentliche Methode CancelPendingRequests Cancel all pending requests on this instance.
Öffentliche Methode DeleteAsync(String)
Öffentliche Methode DeleteAsync(Uri)
Öffentliche Methode DeleteAsync(String, CancellationToken)
Öffentliche Methode DeleteAsync(Uri, CancellationToken)
Öffentliche Methode Dispose() (Geerbt von HttpMessageInvoker.)
Geschützte Methode Dispose(Boolean) Releases the unmanaged resources used by the HttpClient and optionally disposes of the managed resources. (Überschreibt HttpMessageInvoker.Dispose(Boolean).)
Öffentliche Methode Equals (Geerbt von Object.)
Geschützte Methode Finalize (Geerbt von Object.)
Öffentliche Methode GetAsync(String)
Öffentliche Methode GetAsync(Uri)
Öffentliche Methode GetAsync(String, HttpCompletionOption)
Öffentliche Methode GetAsync(String, CancellationToken)
Öffentliche Methode GetAsync(Uri, HttpCompletionOption)
Öffentliche Methode GetAsync(Uri, CancellationToken)
Öffentliche Methode GetAsync(String, HttpCompletionOption, CancellationToken)
Öffentliche Methode GetAsync(Uri, HttpCompletionOption, CancellationToken)
Öffentliche Methode GetByteArrayAsync(String)
Öffentliche Methode GetByteArrayAsync(Uri)
Öffentliche Methode GetHashCode (Geerbt von Object.)
Öffentliche Methode GetStreamAsync(String)
Öffentliche Methode GetStreamAsync(Uri)
Öffentliche Methode GetStringAsync(String)
Öffentliche Methode GetStringAsync(Uri)
Öffentliche Methode GetType (Geerbt von Object.)
Geschützte Methode MemberwiseClone (Geerbt von Object.)
Öffentliche Methode PostAsync(String, HttpContent)
Öffentliche Methode PostAsync(Uri, HttpContent)
Öffentliche Methode PostAsync(String, HttpContent, CancellationToken)
Öffentliche Methode PostAsync(Uri, HttpContent, CancellationToken)
Öffentliche Methode PutAsync(String, HttpContent)
Öffentliche Methode PutAsync(Uri, HttpContent)
Öffentliche Methode PutAsync(String, HttpContent, CancellationToken)
Öffentliche Methode PutAsync(Uri, HttpContent, CancellationToken)
Öffentliche Methode SendAsync(HttpRequestMessage)
Öffentliche Methode SendAsync(HttpRequestMessage, HttpCompletionOption)
Öffentliche Methode SendAsync(HttpRequestMessage, CancellationToken) (Überschreibt HttpMessageInvoker.SendAsync(HttpRequestMessage, CancellationToken).)
Öffentliche Methode SendAsync(HttpRequestMessage, HttpCompletionOption, CancellationToken)
Öffentliche Methode ToString (Geerbt von Object.)

Zum Anfang

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic)-Elemente dieses Typs sind Threadsicher. Für Instanzelemente wird die Threadsicherheit nicht gewährleistet.

Siehe auch

Verweis

System.Net.Http-Namespace