Answers for "php api call with headers"

PHP
0

php api call with headers

<?php
$options = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"CustomHeader: yay\r\n" .
              "AnotherHeader: test\r\n"
  )
);
$context=stream_context_create($options);
$data=file_get_contents('http://www.someservice.com/api/fetch?key=1234567890',false,$context);
?>
Posted by: Guest on October-25-2021

Browse Popular Code Answers by Language