How can I check if I have $HTTP_RAW_POST_DATA available when using nuSOAP in PHP?

When using nuSOAP in PHP, you can check if you have $HTTP_RAW_POST_DATA available by using the isset() function. If $HTTP_RAW_POST_DATA is not available, you can use the php://input stream to retrieve the raw POST data.

if(isset($HTTP_RAW_POST_DATA)){
    // $HTTP_RAW_POST_DATA is available
    $rawData = $HTTP_RAW_POST_DATA;
} else {
    // $HTTP_RAW_POST_DATA is not available, use php://input stream
    $rawData = file_get_contents("php://input");
}