ReqRest
Show / Hide Table of Contents

Class JsonHttpContentBuilderExtensions

Extends the IHttpRequestMessageBuilder interface with methods for dealing with JSON data.

Inheritance
Object
JsonHttpContentBuilderExtensions
Namespace: ReqRest.Serializers.NewtonsoftJson
Assembly: ReqRest.Serializers.NewtonsoftJson.dll
Syntax
public static class JsonHttpContentBuilderExtensions

Methods

SetJsonContent<T>(T, Nullable<Object>, Nullable<Encoding>, Nullable<JsonHttpContentSerializer>)

Sets the HTTP content to a serialized JSON string representing content.

content is serialized using the specified serializer and encoding. The serialized HTTP content has the application/json media type.

Declaration
public static T SetJsonContent<T>(this T builder, object? content, Encoding? encoding = default(Encoding? ), JsonHttpContentSerializer? serializer = default(JsonHttpContentSerializer? ))
    where T : IHttpContentBuilder
Parameters
Type Name Description
T builder

The request builder.

Nullable<Object> content

The content to be sent with the request.

Nullable<Encoding> encoding

The encoding to be used for converting the serialized content to bytes. If null, UTF8 is used.

Nullable<JsonHttpContentSerializer> serializer

The JsonHttpContentSerializer to be used for the content serialization.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
Back to top Copyright © 2019 ReqRest - Generated with DocFX - Material Theme made by Oscar Vásquez - Impressum (Imprint)