encode<V> static method

V encode<V>(
  1. ForwardedRequestDetails instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  ForwardedRequestDetails instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'body',
    instance.body,
  );
  container.encodeList(
    'headers',
    (container) =>
        instance.headers.forEach((el) => ForwardedRequestHeader.encode(
              el,
              container.nestedSingleValueContainer().encoder,
            )),
  );
  container.encodeString(
    'http_method',
    'POST',
  );
  return container.value;
}