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