Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ JsonContent() [1/2]

System.Net.Http.Json.JsonContent< TValue >.JsonContent ( object inputValue,
Type inputType,
MediaTypeHeaderValue mediaType,
JsonSerializerOptions options )
inlineprivate

Definition at line 21 of file JsonContent.cs.

22 {
23 if (inputType == null)
24 {
25 throw new ArgumentNullException("inputType");
26 }
27 if (inputValue != null && !inputType.IsAssignableFrom(inputValue.GetType()))
28 {
30 }
33 base.Headers.ContentType = mediaType ?? JsonHelpers.GetDefaultMediaType();
34 _jsonSerializerOptions = options ?? JsonHelpers.s_defaultSerializerOptions;
35 }
readonly JsonSerializerOptions _jsonSerializerOptions
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string SerializeWrongType
Definition SR.cs:16
Definition SR.cs:7

References System.Net.Http.Json.JsonContent< TValue >._jsonSerializerOptions, System.Text.Json.Dictionary, System.SR.Format(), System.Net.Http.Json.JsonHelpers.GetDefaultMediaType(), System.Net.Http.Json.JsonContent< TValue >.ObjectType, System.options, System.Net.Http.Json.JsonHelpers.s_defaultSerializerOptions, System.SR.SerializeWrongType, and System.Net.Http.Json.JsonContent< TValue >.Value.

Referenced by System.Net.Http.Json.JsonContent< TValue >.Create().