'Alice', 'age' => 25); $options = array( 'http' => array( 'header' => "Content-type: application/json\r\n", 'method' => 'POST', 'content' => json_encode($data) ) ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); echo $response; ?>
new CURLFile($file_path))); $response = curl_exec($curl); curl_close($curl); echo $response; ?>Package library: cURL