GET send
This commit is contained in:
@@ -377,6 +377,16 @@ abstract class BaseController extends Controller
|
|||||||
// $curl = curl_init();
|
// $curl = curl_init();
|
||||||
$curl = curl_init($url);
|
$curl = curl_init($url);
|
||||||
switch ($method) {
|
switch ($method) {
|
||||||
|
case "GET":
|
||||||
|
$params2 = '';
|
||||||
|
foreach($data as $key2=>$value2)
|
||||||
|
$params2 .= $key2.'='.$value2.'&';
|
||||||
|
|
||||||
|
$params2 = trim($params2, '&');
|
||||||
|
$url = $url.'?'.$params2;// add param to URL
|
||||||
|
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
break;
|
||||||
case "POST":
|
case "POST":
|
||||||
curl_setopt($curl, CURLOPT_POST, 1);
|
curl_setopt($curl, CURLOPT_POST, 1);
|
||||||
if ($data)
|
if ($data)
|
||||||
|
|||||||
Reference in New Issue
Block a user