如何使用CURL获取POST数据?

I want to turn OFF allow_url_fopen for security reasons. If I turn it off, I cannot use file_get_contents.

I'm using file_get_contents with php://input and URL. as I need to get the POST data with it. Something like this:

$postData = file_get_contents('php://input'); // Example 1
$postData2 = file_get_contents('https://www.google.com/recaptcha/api/siteverify', false, $context); // Example 2

Is there any way I can get the POST data by using CURL or any other secure way?