ares333/php-curl

The args parameter is set to unavailable.

Closed this issue · 3 comments

The args parameter is set, but it is not received by the backend.
This is the code:
Ares333\Curl\Curl;
$curl = new Curl();
$curl->add(
array(
'opt' => array(
CURLOPT_URL => 'http://127.0.0.1:8080/cs/request.php',
CURLOPT_RETURNTRANSFER => true
),
'args' => array(
"word"=>"你好"
)
),
function ($r, $args) {
echo "Request success for " . $r['info']['url'] . "
";
echo "
Header info:
";
print_r($r['info']);
echo "
Raw header:
";
print_r($r['header']);
echo "
Args:
";
print_r($args);
echo "

Body size:
";
echo strlen($r['body']) . ' bytes';
echo "
";
echo "
Body:
";
echo "

".htmlspecialchars($r['body'])."
";
// print_r($r);
});
$curl->start();

This is the return:
GET:Array
(
)

bgg10 commented

url换成 https://www.baidu.com 之后没法发现问题