Код: Выделить всё
public function callAPI_POST (string $API_URL, array $Params) {
$EncodedParams = json_encode ($Params);
$postOptions = [
'http' => [
'method' => 'POST',
'header' => [ 'Authorization: Bearer ' . $this->getAuthToken (),
'Content-type: application/json',
'Accept: application/json' ],
'content' => $EncodedParams,
],
];
$context = stream_context_create ($postOptions);
$callReply = file_get_contents ($API_URL, false, $context);
if ($callReply === FALSE) {
$callReply = NULL;
}
if ($callReply != NULL) {
$ReplyArray = json_decode($callReply, TRUE);
php Warning:
file_get_contents(https://www.geni.com/api/ Профиль-34838408159 /Обновление):
Не удалось открыть потоки: HTTP-запрос не удастся! Http/1.1 403 forbidden
Администратор сервера говорит>
Подробнее здесь: https://stackoverflow.com/questions/794 ... ved-as-get
Мобильная версия