Skip to content

Commit 42335d8

Browse files
author
Fabrizio Branca
committed
Handle put commands (needed for SauceRest->updateJob())
1 parent 5ce678a commit 42335d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/WebDriver/Service/CurlService.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
5353
}
5454
} else if ($requestMethod == 'DELETE') {
5555
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
56+
} else if ($requestMethod == 'PUT') {
57+
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
58+
if ($parameters && is_array($parameters)) {
59+
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters));
60+
} else {
61+
$customHeaders[] = 'Content-Length: 0';
62+
}
5663
}
5764

5865
foreach ($extraOptions as $option => $value) {

0 commit comments

Comments
 (0)