contentType = JsonBody::getContentType($api); $this->jsonFormatter = $jsonFormatter ?: new JsonBody($api); } protected function payload(StructureShape $member, array $value, array &$opts) { $body = isset($value) ? ((string) $this->jsonFormatter->build($member, $value)) : "{}"; $opts['headers']['Content-Type'] = $this->contentType; $opts['body'] = $body; } }