fetch('gy25.php?api')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const subjectCode = 'AKTI';
fetch(`gy25.php?code=${subjectCode}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('gy25.php?api');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
print_r($data);
$subjectCode = 'AKTI';
$ch = curl_init('gy25.php?code=' . urlencode($subjectCode));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
print_r($data);
| Endpoint | Metod | Beskrivning | Exempel | Svarsdata |
|---|---|---|---|---|
/gy25.php?api |
GET | Hämta alla ämnen | /gy25.php?api |
|
|
||||
/gy25.php?code=AKTI |
GET | Hämta ämnesinformation | /gy25.php?code=AKTI |
|
|
||||