-
Notifications
You must be signed in to change notification settings - Fork 0
/
curl.php
46 lines (26 loc) · 916 Bytes
/
curl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
$pdata=array('height' => "111");
$postfields="get_block_record_by_height";
$url="https://localhost/".$postfields;
$postData = json_encode($pdata);
$ch = curl_init();
$params[CURLOPT_URL] = $url;
$params[CURLOPT_HEADER] = false;
$params[CURLOPT_RETURNTRANSFER] = true;
$params[CURLOPT_FOLLOWLOCATION] = true;
$params[CURLOPT_POST] = true;
$params[CURLOPT_PORT] = 8555;
$params[CURLOPT_POSTFIELDS] = $postData;
$params[CURLOPT_SSL_VERIFYPEER] = false;
$params[CURLOPT_SSL_VERIFYHOST] = false;
$params[CURLOPT_SSLCERTTYPE] = 'PEM';
$params[CURLOPT_SSLCERT] = 'pcrt.pem';
$params[CURLOPT_SSLKEYTYPE] = 'PEM';
$params[CURLOPT_SSLKEY] = 'pkey.pem';
curl_setopt_array($ch, $params);
$content = curl_exec($ch);
$output = curl_getinfo($ch);
curl_close($ch);
echo $content."<br>";
//print_r($output);
?>