我刚刚找到了解决方案,可以回答我自己的问题,以防其他人偶然发现它。
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, "http://url/url/url" );curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );curl_setopt($ch, CURLOPT_POST,1 );curl_setopt($ch, CURLOPT_POSTFIELDS, "body goes here" ); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain'));$result=curl_exec ($ch);


