迁移到SSL后,$ _SERVER ['REQUEST_METHOD']发生了变化

We recently migrated to SSL, and the site works great with the exception of one function. The function uses curl in the code below to execute an api located on the same server. The url variable for this function is: news.hubsdev.com/administrator/index.php?option=com_api&task=acymailing.listcreate

it returned a 301 error, until we added

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);

However, now it returns a an error due to the fact that the global variable $_SERVER['REQUEST_METHOD'] has changed somehow. It returns an error when we test to make sure it is "POST" using the following:

if ($_SERVER['REQUEST_METHOD'] !== 'POST') {

Could our switch to SSL change this variable? How can we fix this?

Thanks, Ken

Following a 301 redirect can cause a POST request to be followed up with a GET request.

Change the URL you are requesting to the URL you actually want (i.e. not the old one that now returns a redirect instruction).