ReqRest
Show / Hide Table of Contents

Class JsonHttpMethodBuilderExtensions

Provides static builder extension methods dealing with the HTTP method and JSON.

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

Methods

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

Sets the HttpMethod to the HTTP PATCH method and then 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 PatchJson<T>(this T builder, object? content, Encoding? encoding = default(Encoding? ), JsonHttpContentSerializer? serializer = default(JsonHttpContentSerializer? ))
    where T : IHttpMethodBuilder, 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.

Remarks

Calling this method is equivalent to calling Post<T>(T) and in order.

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

Sets the HttpMethod to the HTTP POST method and then 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 PostJson<T>(this T builder, object? content, Encoding? encoding = default(Encoding? ), JsonHttpContentSerializer? serializer = default(JsonHttpContentSerializer? ))
    where T : IHttpMethodBuilder, 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.

Remarks

Calling this method is equivalent to calling Post<T>(T) and in order.

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

Sets the HttpMethod to the HTTP PUT method and then 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 PutJson<T>(this T builder, object? content, Encoding? encoding = default(Encoding? ), JsonHttpContentSerializer? serializer = default(JsonHttpContentSerializer? ))
    where T : IHttpMethodBuilder, 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.

Remarks

Calling this method is equivalent to calling Post<T>(T) and in order.

Back to top Copyright © 2019 ReqRest - Generated with DocFX - Material Theme made by Oscar Vásquez - Impressum (Imprint)