← All changes
|
includes/sdk/s3/Aws/Api/Serializer/RestXmlSerializer.php
+4
-2
1.2.7
→
1.4.2
View file →
| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | * @param Service $api Service API description |
| 16 | 16 | * @param string $endpoint Endpoint to connect to |
| 17 | 17 | * @param XmlBody $xmlBody Optional XML formatter to use |
| 18 | 18 | */ |
| 19 | - public function __construct(Service $api, $endpoint, XmlBody $xmlBody = null) | |
| 19 | + public function __construct(Service $api, $endpoint, ?XmlBody $xmlBody = null) | |
| 20 | 20 | { |
| 21 | 21 | parent::__construct($api, $endpoint); |
| 22 | 22 | $this->xmlBody = $xmlBody ?: new XmlBody($api); |
| 23 | 23 | } |
| @@ -23,9 +23,11 @@ | ||
| 23 | 23 | } |
| 24 | 24 | protected function payload(StructureShape $member, array $value, array &$opts) |
| 25 | 25 | { |
| 26 | 26 | $opts['headers']['Content-Type'] = 'application/xml'; |
| 27 | - $opts['body'] = $this->getXmlBody($member, $value); | |
| 27 | + $body = $this->getXmlBody($member, $value); | |
| 28 | + $opts['headers']['Content-Length'] = \strlen($body); | |
| 29 | + $opts['body'] = $body; | |
| 28 | 30 | } |
| 29 | 31 | /** |
| 30 | 32 | * @param StructureShape $member |
| 31 | 33 | * @param array $value |