![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/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; } }