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 :: woocommerce check if shop page 
Php :: combine date time php 
Php :: Select specefied columns from all data in laravel 
Php :: what should write for getting extension of image in php 
Php :: find string lenght in php 
Php :: stripslash 
Php :: my xampp 
Php :: phpunit/phpunit[6.0.0, ..., 6.5.14] require php ^7.0 - your php version (8.0.0) does not satisfy that requirement. 
Php :: php cheat sheet 
Php :: laravel transaction 
Php :: unless blade laravel 
Php :: phpstorm deployment 
Php :: facade pattern php 
Java :: import collectors java 
Java :: convert string to localdatetime 
Java :: jenkins decrypt password script console 
Java :: lombok maven dependency 
Java :: java log base 2 
Java :: java stream find specific element 
Java :: creating random color in java 
Java :: base64.decode android 
Java :: Thread inline ajva 
Java :: java reentrantlock 
Java :: how to print a 2d array in java 
Java :: java import swing 
Java :: how to implement linked list in java without using collection framework 
Java :: java how to get fps 
Java :: Duplicate class android.support.v4.app. 
Java :: get long from date java 
Java :: create color object java 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =