I need to check for the HTTP Response from a XML endpoint in PHP http_response_code() returns 200ok, but I need to know the response from the actual endpoint. I think I am blocked on the firewall because of prior failures.
Please be kind and ask me if I am not making myself clear. I understand it should be fairly straightforward.
$auth = base64_encode ( $this->config->item ( "user" ) . ":" . $this->config->item ( "pass" ) );
$context = stream_context_create ( array ('http' => array ('header' => "Authorization: Basic $auth" ) ) );
$unitsXML = file_get_contents ( $this->config->item ( "server_url" ) . "/", false, $context );
libxml_use_internal_errors ( true );
$objXML = simplexml_load_string ( $unitsXML );
var_dump(http_response_code()); // <- this returns 200ok, ut how to get this code but from simplexml http request?
At the moment I only have a blank page with null