-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget.php
More file actions
38 lines (27 loc) · 776 Bytes
/
Copy pathget.php
File metadata and controls
38 lines (27 loc) · 776 Bytes
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
<?php
// $_
$form_data = $_GET;
$post_fields = ''; // No POST fields to send for GET requests
$headers = getallheaders();
$curl_headers = array();
foreach ($headers as $key => $value) {
$curl_headers[] = "$key: $value";
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:5000/accountsummary');
// curl_setopt is a function that sets options for the cURL request.
// If it's a POST request, set the POST fields
curl_setopt($ch, CURLOPT_HTTPGET, true); // This is a GET request
curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
// echo "f";
if ($response) {
echo $response;
}
else{
echo "flask server down";
}
// Close the cURL session
curl_close($ch);
?>