Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Member group

PostAsJson

Declaring type: HttpClientJsonExtensions
Module: System.Web.Http.Json
Assembly: System.Web.dll

Overloads / Variants

PostAsJson

func PostAsJson<T>(url: string, value: T, cancellationToken: CancellationToken = default) -> Task<Result<HttpResponse, HttpError | JsonError>>

Extension from HttpClientJsonExtensions.PostAsJson

Serializes a supported flat model and returns the HTTP response, including non-success status.

Parameters

Name Type Description
self HttpClient
url String
value T
cancellationToken CancellationToken

Return value

Task<Result<HttpResponse, HttpError | JsonError>>

PostAsJson

func PostAsJson<T>(url: Uri, value: T, cancellationToken: CancellationToken = default) -> Task<Result<HttpResponse, HttpError | JsonError>>

Extension from HttpClientJsonExtensions.PostAsJson

Serializes a supported flat model and returns the HTTP response, including non-success status.

Parameters

Name Type Description
self HttpClient
url Uri
value T
cancellationToken CancellationToken

Return value

Task<Result<HttpResponse, HttpError | JsonError>>