DownstreamApiOptions.Serializer Property

Definition

Optional serializer. Will serialize the input to the web API (if any). By default, when not provided:

  • If the input derives from HttpInput, it's used as is
  • If the input is a string it's used as is an considered a media type json.
  • Otherwise, the object is serialized in JSON, with a UTF8 encoding, and a media type of application/json:
    new StringContent(JsonSerializer.Serialize(input), Encoding.UTF8, "application/json")
    
public Func<object?,System.Net.Http.HttpContent?>? Serializer { get; set; }
member this.Serializer : Func<obj, System.Net.Http.HttpContent> with get, set
Public Property Serializer As Func(Of Object, HttpContent)

Property Value

Remarks

This property cannot be set in the configuration. It's code only.

Applies to