![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/aws/aws-sdk-php/src/Api/Serializer/ |
<?php namespace Aws\Api\Serializer; use Aws\Api\Service; use Aws\Api\StructureShape; /** * Serializes requests for the REST-JSON protocol. * @internal */ class RestJsonSerializer extends RestSerializer { /** @var JsonBody */ private $jsonFormatter; /** @var string */ private $contentType; /** * @param Service $api Service API description * @param string $endpoint Endpoint to connect to * @param JsonBody $jsonFormatter Optional JSON formatter to use */ public function __construct( Service $api, $endpoint, JsonBody $jsonFormatter = null ) { parent::__construct($api, $endpoint); $this->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; } }