جای استفاده از file_get_contents از cURL استفاده کنید.
یک نمونه کد ساده رو براتون نوشتم:
کد:<?php $url = "https://api.telegram.org/token/method"; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_POSTFIELDS,$datas); $res = curl_exec($ch);