BloomRpcContract<TInput, TOutput>.post constructor
const
BloomRpcContract<TInput, TOutput>.post (})
Shorthand constructor for an HTTP POST endpoint contract.
const createPost = BloomRpcContract<CreatePostInput, Post>.post(
'/posts',
encodeInput: (input) => input.toJson(),
decodeOutput: Post.fromJson,
);
Implementation
const BloomRpcContract.post(
String pathTemplate, {
dynamic Function(TInput input)? encodeInput,
TInput Function(dynamic json)? decodeInput,
dynamic Function(TOutput output)? encodeOutput,
TOutput Function(dynamic json)? decodeOutput,
String? summary,
String? description,
List<dynamic> Function(TInput input)? customCacheKey,
}) : this(
method: BloomHttpMethod.post,
pathTemplate: pathTemplate,
encodeInput: encodeInput,
decodeInput: decodeInput,
encodeOutput: encodeOutput,
decodeOutput: decodeOutput,
summary: summary,
description: description,
customCacheKey: customCacheKey,
);