How can I forward $_POST with PHP and cURL?

api, curl, php, post

Solution

Perhaps:

curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);

From curl_setopt:

This can either be passed as a urlencoded string like 'para1=val1&para2=val2&...' or as an array with the field name as key and field data as value.

Problem

I receive a POST request at my PHP script and would like to forward this POST call to another script using POST too. How can I do this? I can use cURL if it's required for this action.

Original source