This commit is contained in:
2026-06-07 21:22:22 +07:00
parent a70150e088
commit bde929158b
12 changed files with 328 additions and 96 deletions
+10
View File
@@ -0,0 +1,10 @@
<?php
$ch = curl_init('http://localhost/webtugas/01/api/save_jalan.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"nama":"Jl. Test","status":"Kabupaten","panjang":100,"koordinat":[[0,0]]}');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$res = curl_exec($ch);
echo "RAW RESPONSE: |" . $res . "|\n";
echo "JSON DECODE: " . (json_decode($res) ? "OK" : json_last_error_msg());
?>