resolveBodySync static method

Object? resolveBodySync(
  1. dynamic payload,
  2. APIResponse apiResponse
)

Resolves a payload to an HTTP body (Does NOT accept payload as a Future). See resolveBody.

Implementation

static Object? resolveBodySync(dynamic payload, APIResponse apiResponse) {
  if (payload == null) return null;

  if (payload is Future) {
    throw ArgumentError(
        "`payload` can't be a `Future`. Use `resolveBody` for asynchronous call.");
  }

  return _resolveBodyImpl(payload, apiResponse);
}