Search
 
SCRIPT & CODE EXAMPLE
 

PHP

api headers php

<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: access");
header("Access-Control-Allow-Methods: POST");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
?>
Comment

php api call with headers

<?php
$options = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"CustomHeader: yay
" .
              "AnotherHeader: test
"
  )
);
$context=stream_context_create($options);
$data=file_get_contents('http://www.someservice.com/api/fetch?key=1234567890',false,$context);
?>
Comment

PREVIOUS NEXT
Code Example
Php :: tmp cakephp name 
Php :: php regex remove file extension 
Php :: how to get browser info in php 
Php :: In Connection.php line 664:SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema 
Php :: is number divisible by 3 php 
Php :: how to run specific seeder in laravel 
Php :: php get only numbers 
Php :: Enable / Disable modules in PHP 
Php :: php mkdir if not exists 
Php :: session has laravel blade 
Php :: determine special characters in php 
Php :: remove add media button wordpress editor 
Php :: php append to array 
Php :: Laravel loop with counter 
Php :: php artisan serve specify ip 
Php :: php sha256 example 
Php :: unzip file php 
Php :: display errors in codeigniter 
Php :: how to delete image from aws using laravel 8 
Php :: asia time zone in php 
Php :: migrate symfony command 
Php :: htaccess replace url parameter with slash prameter 
Php :: php exit foreach 
Php :: laravel controller return message 
Php :: wp show logo 
Php :: php datetime add one hour 
Php :: yii2 sql query 
Php :: php delete a folder 
Php :: Hide all updates from WordPress 
Php :: doctrine php driver execption 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =