Spaces:
Sleeping
Sleeping
// API endpoint URL | |
$url = 'https://vaibhav84-resumeapi.hf.space/UpdateSkillDetails/'; | |
// Define the input data | |
$data = array( | |
"SkillName" => "Test4", | |
"SkillWeightage" => -3 // Example weightage | |
); | |
// Initialize cURL | |
$curl = curl_init(); | |
// Set cURL options | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => $url, | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_CUSTOMREQUEST => "PUT", | |
CURLOPT_POSTFIELDS => json_encode($data), | |
CURLOPT_HTTPHEADER => array( | |
"Content-Type: application/json" | |
), | |
)); | |
// Execute the cURL request | |
$response = curl_exec($curl); | |
// Check for errors | |
if (curl_errno($curl)) { | |
echo 'Error: ' . curl_error($curl); | |
} else { | |
// Print response | |
echo "Skill details updated successfully.\n"; | |
echo "Response: " . $response . "\n"; | |
} | |
// Close cURL | |
curl_close($curl); | |