Merhaba, daha önce Reyna’nın paylaşmış olduğu kodun Php halidir. Reyna’ya selamlar.
Kod:
Hide <?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$tc = '11111111110';
$ASPNET_SessionId = '31313131313131';
$client = new Client([
'headers' => [
'accept' => 'application/json, text/javascript, /; q=0.01',
'accept-language' => 'tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7',
'content-type' => 'application/json; charset=UTF-8',
'sec-ch-ua' => '"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"',
'sec-ch-ua-mobile' => '?0',
'sec-ch-ua-platform' => '"Windows"',
'sec-fetch-dest' => 'empty',
'sec-fetch-mode' => 'cors',
'sec-fetch-site' => 'same-origin',
'x-requested-with' => 'XMLHttpRequest',
],
'cookies' => [
'ASP.NET_SessionId' => $ASPNET_SessionId,
],
'verify' => false,
]);
// Request 1
$data1 = [
'Keys' => ['ogrTcNo'],
'Degerler' => [$tc],
];
$response1 = $client->post('https://e-okul.meb.gov.tr/IlkOgretim/OKL/IOK27007.aspx/ogrenciGetir', [
'json' => $data1,
]);
// Request 2
$data2 = [
'fotovarmi' => '1',
];
$response2 = $client->post('https://e-okul.meb.gov.tr/IlkOgretim/OKL/IOK27007.aspx/fotoGetir', [
'json' => $data2,
]);
// Request 3
$response3 = $client->get('https://e-okul.meb.gov.tr/IlkOgretim/OKL/OKLResimGoster.aspx');
$image_data = $response3->getBody()->getContents();
$base64_data = base64_encode($image_data);
echo $base64_data;
?>