diff --git a/src/Client.php b/src/Client.php index 51dfe4e32..19719360a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -437,6 +437,11 @@ private function applyOptions(RequestInterface $request, array &$options): Reque } } + if (isset($options['version'])) { + $modify['version'] = $options['version']; + unset($options['version']); + } + $request = Psr7\Utils::modifyRequest($request, $modify); if ($request->getBody() instanceof Psr7\MultipartStream) { // Use a multipart/form-data POST if a Content-Type is not set. @@ -446,10 +451,6 @@ private function applyOptions(RequestInterface $request, array &$options): Reque . $request->getBody()->getBoundary(); } - if (isset($options['version'])) { - $modify['version'] = $options['version']; - } - // Merge in conditional headers if they are not present. if (isset($options['_conditional'])) { // Build up the changes so it's in a single clone of the message.