getRequestBody function

String? getRequestBody(
  1. APIType type,
  2. HttpRequestModel httpRequestModel
)

Implementation

String? getRequestBody(APIType type, HttpRequestModel httpRequestModel) {
  return switch (type) {
    APIType.rest =>
      (httpRequestModel.hasJsonData || httpRequestModel.hasTextData)
          ? httpRequestModel.body
          : null,
    APIType.graphql => getGraphQLBody(httpRequestModel),
    APIType.ai => null, //TODO: TAKE A LOOK
  };
}