Lines Matching refs:ch
8 function testcurl($ch, $name, $mime = '', $postname = '')
17 curl_setopt($ch, CURLOPT_POSTFIELDS, array("file" => $file));
18 var_dump(curl_exec($ch));
23 $ch = curl_init();
24 curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=file");
25 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
27 testcurl($ch, __DIR__ . '/curl_testdata1.txt');
28 testcurl($ch, __DIR__ . '/curl_testdata1.txt', 'text/plain');
29 testcurl($ch, __DIR__ . '/curl_testdata1.txt', '', 'foo.txt');
30 testcurl($ch, __DIR__ . '/curl_testdata1.txt', 'text/plain', 'foo.txt');
36 curl_setopt($ch, CURLOPT_POSTFIELDS, array("file" => $file));
37 var_dump(curl_exec($ch));
42 curl_setopt($ch, CURLOPT_POSTFIELDS, array("file" => $file));
43 var_dump(curl_exec($ch));
46 curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
47 var_dump(curl_exec($ch));
49 curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);
51 curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
52 var_dump(curl_exec($ch));
54 curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=post");
56 curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
57 var_dump(curl_exec($ch));
59 curl_close($ch);