buildRequestBody method

HttpRequestBody buildRequestBody(
  1. HttpClient client,
  2. HttpRequestBody httpBody,
  3. Authorization? authorization
)

Helper to build the request body.

Implementation

HttpRequestBody buildRequestBody(HttpClient client, HttpRequestBody httpBody,
    Authorization? authorization) {
  if (authorization != null && authorization.isCredentialResolved) {
    var jsonBody = authorization.resolvedCredential!.buildBody(httpBody);
    if (jsonBody != null) return jsonBody;
  }

  return httpBody;
}