From 0ec90369a1146d4f1da2cdcbea9723b3075937c3 Mon Sep 17 00:00:00 2001 From: mean-cj Date: Wed, 18 May 2022 14:12:06 +0700 Subject: [PATCH] add CURLOPT_CUSTOMREQUEST for get/post function --- src/Curl/Curl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index d3eaa1a..ba1dca3 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -304,6 +304,7 @@ public function _exec() */ public function get($url, $data = array()) { + $this->setOpt(CURLOPT_CUSTOMREQUEST, "GET"); if (count($data) > 0) { $this->setOpt(CURLOPT_URL, $url.'?'.http_build_query($data)); } else { @@ -324,6 +325,7 @@ public function get($url, $data = array()) */ public function post($url, $data = array(), $asJson = false) { + $this->setOpt(CURLOPT_CUSTOMREQUEST, "POST"); $this->setOpt(CURLOPT_URL, $url); if ($asJson) { $this->prepareJsonPayload($data);