HttpClientJsonExtensions.PostAsJsonAsync Methode

Definition

Überlädt

Name Beschreibung
PostAsJsonAsync<TValue>(HttpClient, String, TValue, CancellationToken)

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

PostAsJsonAsync<TValue>(HttpClient, Uri, TValue, CancellationToken)

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

PostAsJsonAsync<TValue>(HttpClient, String, TValue, JsonSerializerOptions, CancellationToken)

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

PostAsJsonAsync<TValue>(HttpClient, String, TValue, JsonTypeInfo<TValue>, CancellationToken)

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

PostAsJsonAsync<TValue>(HttpClient, Uri, TValue, JsonSerializerOptions, CancellationToken)

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

PostAsJsonAsync<TValue>(HttpClient, Uri, TValue, JsonTypeInfo<TValue>, CancellationToken)

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

PostAsJsonAsync<TValue>(HttpClient, String, TValue, CancellationToken)

Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PostAsJsonAsync(System::Net::Http::HttpClient ^ client, System::String ^ requestUri, TValue value, System::Threading::CancellationToken cancellationToken);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, TValue value, System.Threading.CancellationToken cancellationToken);
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, TValue value, System.Threading.CancellationToken cancellationToken);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, TValue value, System.Threading.CancellationToken cancellationToken);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member PostAsJsonAsync : System.Net.Http.HttpClient * string * 'Value * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
static member PostAsJsonAsync : System.Net.Http.HttpClient * string * 'Value * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member PostAsJsonAsync : System.Net.Http.HttpClient * string * 'Value * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
<Extension()>
Public Function PostAsJsonAsync(Of TValue) (client As HttpClient, requestUri As String, value As TValue, cancellationToken As CancellationToken) As Task(Of HttpResponseMessage)

Typparameter

TValue

Der Typ des zu serialisierenden Werts.

Parameter

client
HttpClient

Der Client, der zum Senden der Anforderung verwendet wurde.

requestUri
String

Der URI, an den die Anforderung gesendet wird.

value
TValue

Der wert, der serialisiert werden soll.

cancellationToken
CancellationToken

Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um eine Kündigungsbenachrichtigung zu erhalten.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Attribute

Ausnahmen

Das Abbruchtoken wurde abgebrochen. Diese Ausnahme wird in der zurückgegebenen Aufgabe gespeichert.

Hinweise

Diese Methode verwendet JsonSerializerDefaults.Web Optionen für die Serialisierung, während JsonSerializer Serialisierungsmethoden standardmäßig nicht verwendet werden.

Gilt für:

PostAsJsonAsync<TValue>(HttpClient, Uri, TValue, CancellationToken)

Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PostAsJsonAsync(System::Net::Http::HttpClient ^ client, Uri ^ requestUri, TValue value, System::Threading::CancellationToken cancellationToken);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, TValue value, System.Threading.CancellationToken cancellationToken);
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, TValue value, System.Threading.CancellationToken cancellationToken);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, TValue value, System.Threading.CancellationToken cancellationToken);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member PostAsJsonAsync : System.Net.Http.HttpClient * Uri * 'Value * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
static member PostAsJsonAsync : System.Net.Http.HttpClient * Uri * 'Value * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member PostAsJsonAsync : System.Net.Http.HttpClient * Uri * 'Value * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
<Extension()>
Public Function PostAsJsonAsync(Of TValue) (client As HttpClient, requestUri As Uri, value As TValue, cancellationToken As CancellationToken) As Task(Of HttpResponseMessage)

Typparameter

TValue

Der Typ des zu serialisierenden Werts.

Parameter

client
HttpClient

Der Client, der zum Senden der Anforderung verwendet wurde.

requestUri
Uri

Der URI, an den die Anforderung gesendet wird.

value
TValue

Der wert, der serialisiert werden soll.

cancellationToken
CancellationToken

Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um eine Kündigungsbenachrichtigung zu erhalten.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Attribute

Ausnahmen

Das Abbruchtoken wurde abgebrochen. Diese Ausnahme wird in der zurückgegebenen Aufgabe gespeichert.

Hinweise

Diese Methode verwendet JsonSerializerDefaults.Web Optionen für die Serialisierung, während JsonSerializer Serialisierungsmethoden standardmäßig nicht verwendet werden.

Gilt für:

PostAsJsonAsync<TValue>(HttpClient, String, TValue, JsonSerializerOptions, CancellationToken)

Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, TValue value, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, TValue value, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, TValue value, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member PostAsJsonAsync : System.Net.Http.HttpClient * string * 'Value * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
static member PostAsJsonAsync : System.Net.Http.HttpClient * string * 'Value * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member PostAsJsonAsync : System.Net.Http.HttpClient * string * 'Value * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
<Extension()>
Public Function PostAsJsonAsync(Of TValue) (client As HttpClient, requestUri As String, value As TValue, Optional options As JsonSerializerOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpResponseMessage)

Typparameter

TValue

Der Typ des zu serialisierenden Werts.

Parameter

client
HttpClient

Der Client, der zum Senden der Anforderung verwendet wurde.

requestUri
String

Der URI, an den die Anforderung gesendet wird.

value
TValue

Der wert, der serialisiert werden soll.

options
JsonSerializerOptions

Optionen zum Steuern des Verhaltens während der Serialisierung. Die Standardoptionen sind die von Web.

cancellationToken
CancellationToken

Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um eine Kündigungsbenachrichtigung zu erhalten.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Attribute

Ausnahmen

Das Abbruchtoken wurde abgebrochen. Diese Ausnahme wird in der zurückgegebenen Aufgabe gespeichert.

Gilt für:

PostAsJsonAsync<TValue>(HttpClient, String, TValue, JsonTypeInfo<TValue>, CancellationToken)

Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, TValue value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);
static member PostAsJsonAsync : System.Net.Http.HttpClient * string * 'Value * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
<Extension()>
Public Function PostAsJsonAsync(Of TValue) (client As HttpClient, requestUri As String, value As TValue, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpResponseMessage)

Typparameter

TValue

Der Typ des zu serialisierenden Werts.

Parameter

client
HttpClient

Der Client, der zum Senden der Anforderung verwendet wurde.

requestUri
String

Der URI, an den die Anforderung gesendet wird.

value
TValue

Der wert, der serialisiert werden soll.

jsonTypeInfo
JsonTypeInfo<TValue>

Die jsonTypeInfo, die zum Steuern des Serialisierungsverhaltens verwendet wird.

cancellationToken
CancellationToken

Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um eine Kündigungsbenachrichtigung zu erhalten.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Ausnahmen

Das Abbruchtoken wurde abgebrochen. Diese Ausnahme wird in der zurückgegebenen Aufgabe gespeichert.

Gilt für:

PostAsJsonAsync<TValue>(HttpClient, Uri, TValue, JsonSerializerOptions, CancellationToken)

Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, TValue value, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, TValue value, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, TValue value, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member PostAsJsonAsync : System.Net.Http.HttpClient * Uri * 'Value * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
static member PostAsJsonAsync : System.Net.Http.HttpClient * Uri * 'Value * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member PostAsJsonAsync : System.Net.Http.HttpClient * Uri * 'Value * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
<Extension()>
Public Function PostAsJsonAsync(Of TValue) (client As HttpClient, requestUri As Uri, value As TValue, Optional options As JsonSerializerOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpResponseMessage)

Typparameter

TValue

Der Typ des zu serialisierenden Werts.

Parameter

client
HttpClient

Der Client, der zum Senden der Anforderung verwendet wurde.

requestUri
Uri

Der URI, an den die Anforderung gesendet wird.

value
TValue

Der wert, der serialisiert werden soll.

options
JsonSerializerOptions

Optionen zum Steuern des Verhaltens während der Serialisierung. Die Standardoptionen sind die von Web.

cancellationToken
CancellationToken

Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um eine Kündigungsbenachrichtigung zu erhalten.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Attribute

Ausnahmen

Das Abbruchtoken wurde abgebrochen. Diese Ausnahme wird in der zurückgegebenen Aufgabe gespeichert.

Gilt für:

PostAsJsonAsync<TValue>(HttpClient, Uri, TValue, JsonTypeInfo<TValue>, CancellationToken)

Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs
Quelle:
HttpClientJsonExtensions.Post.cs

Sendet eine POST-Anforderung an den angegebenen URI, der den value serialisierten ALS JSON im Anforderungstext enthält.

public static System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PostAsJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, TValue value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);
static member PostAsJsonAsync : System.Net.Http.HttpClient * Uri * 'Value * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
<Extension()>
Public Function PostAsJsonAsync(Of TValue) (client As HttpClient, requestUri As Uri, value As TValue, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpResponseMessage)

Typparameter

TValue

Der Typ des zu serialisierenden Werts.

Parameter

client
HttpClient

Der Client, der zum Senden der Anforderung verwendet wurde.

requestUri
Uri

Der URI, an den die Anforderung gesendet wird.

value
TValue

Der wert, der serialisiert werden soll.

jsonTypeInfo
JsonTypeInfo<TValue>

Die jsonTypeInfo, die zum Steuern des Serialisierungsverhaltens verwendet wird.

cancellationToken
CancellationToken

Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um eine Kündigungsbenachrichtigung zu erhalten.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Ausnahmen

Das Abbruchtoken wurde abgebrochen. Diese Ausnahme wird in der zurückgegebenen Aufgabe gespeichert.

Gilt für: