Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
531 B
1
Indexable
Never
<?php
class ApiRequest
{
    private $apiUrl;

    public function __construct($apiUrl)
    {
        $this->apiUrl = $apiUrl;
    }
    public function getRequest()
    {
        $context = stream_context_create();

        $result = file_get_contents($this->apiUrl, false, $context);

        return $result;
    }
}

$apiUrl = "https://localhost:8888/kristapsskola/get_end.php";


$apiRequest = new ApiRequest($apiUrl);


$response = $apiRequest->getRequest();

echo "API Atbilde: " . $response;

?>
Leave a Comment