<?php

function make_post_request($url, $data, $headers = []) {
    $options = array(
        'http' => array(
            'header'  => array_merge([
                "Content-Type: application/json",
                "accept: application/json"
            ], $headers),
            'method'  => 'POST',
            'content' => json_encode($data),
            'ignore_errors' => true
        ),
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    );

    $context  = stream_context_create($options);
    return file_get_contents($url, false, $context);
}

function make_get_request($url, $headers = []) {
    $options = array(
        'http' => array(
            'header'  => array_merge([
                "accept: application/json"
            ], $headers),
            'method'  => 'GET',
            'ignore_errors' => true
        ),
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    );

    $context  = stream_context_create($options);
    return file_get_contents($url, false, $context);
}



?>
