Created
May 26, 2021 14:33
-
-
Save siteslave/d85ba3b9622d42980cabccf5dcc0b701 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$curl = curl_init(); | |
curl_setopt_array($curl, [ | |
CURLOPT_URL => "https://cvp1.moph.go.th/api/ImmunizationHospitalSlot?Action=GetHospitalSlotByMonth&hospital_code=11053&year=2021&month=9&vaccine_plan_no=1", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 30, | |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
CURLOPT_CUSTOMREQUEST => "GET", | |
CURLOPT_POSTFIELDS => "", | |
CURLOPT_HTTPHEADER => [ | |
"Authorization: Bearer eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.iH4Lie4Lii4Liy4Y" | |
], | |
]); | |
$response = curl_exec($curl); | |
$err = curl_error($curl); | |
curl_close($curl); | |
if ($err) { | |
echo "cURL Error #:" . $err; | |
} else { | |
echo $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment