Switched to using file_get_contents for sending the API commands