'John', 'Age' => '24'); // Method specified whether to GET or // POST data with the content specified // by $data variable. 'http' is used // even in case of 'https' $options = array( 'http' => array( 'method' => 'POST', 'content' => http_build_query($data)) ); // Create a context stream with // the specified options $stream = stream_context_create($options); // The data is stored in the // result variable $result = file_get_contents( $url_path, false, $stream); echo $result; ?>