update
This commit is contained in:
@@ -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":"Jalan 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());
|
||||
?>
|
||||
Reference in New Issue
Block a user