Skip to content

Commit 0ec9036

Browse files
authored
add CURLOPT_CUSTOMREQUEST for get/post function
1 parent ec22ad2 commit 0ec9036

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 {
@@ -324,6 +325,7 @@ public function get($url, $data = array())
324325
*/
325326
public function post($url, $data = array(), $asJson = false)
326327
{
328+
$this->setOpt(CURLOPT_CUSTOMREQUEST, "POST");
327329
$this->setOpt(CURLOPT_URL, $url);
328330
if ($asJson) {
329331
$this->prepareJsonPayload($data);

0 commit comments

Comments
 (0)