We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4912355 commit b508f5cCopy full SHA for b508f5c
1 file changed
src/Request.php
@@ -649,14 +649,12 @@ public function getOptions() : array
649
'Invalid Request Protocol: ' . $this->getProtocol()
650
)
651
};
652
- switch ($this->getMethod()) {
653
- case Method::POST:
654
- $options[\CURLOPT_POSTFIELDS] = $this->getPostAndFiles();
655
- break;
656
- case Method::PATCH:
657
- case Method::PUT:
658
- $options[\CURLOPT_POSTFIELDS] = $this->getBody();
659
+ if (\in_array($this->getMethod(), [
+ Method::PATCH,
+ Method::POST,
+ Method::PUT,
+ ], true)) {
+ $options[\CURLOPT_POSTFIELDS] = $this->getPostAndFiles();
660
}
661
$options[\CURLOPT_CUSTOMREQUEST] = $this->getMethod();
662
$options[\CURLOPT_HEADER] = false;
0 commit comments