Skip to content

Commit 7e506d8

Browse files
authored
Merge pull request #85 from mean-cj/patch-1
add CURLOPT_CUSTOMREQUEST for get/post function
2 parents b444a2e + 0ec9036 commit 7e506d8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Curl/Curl.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ public function _exec()
304304
*/
305305
public function get($url, $data = array())
306306
{
307+
$this->setOpt(CURLOPT_CUSTOMREQUEST, "GET");
307308
if (count($data) > 0) {
308309
$this->setOpt(CURLOPT_URL, $url.'?'.http_build_query($data));
309310
} else {
@@ -346,6 +347,7 @@ public function purge($url, $hostName = null)
346347
*/
347348
public function post($url, $data = array(), $asJson = false)
348349
{
350+
$this->setOpt(CURLOPT_CUSTOMREQUEST, "POST");
349351
$this->setOpt(CURLOPT_URL, $url);
350352
if ($asJson) {
351353
$this->prepareJsonPayload($data);

0 commit comments

Comments
 (0)