Answer the question
In order to leave comments, you need to log in
Why is the API request not working?
Wrote code:
<?php
$request = 'https://getbible.net/json?p=James3:5';
$response = file_get_contents($request);
$info = array_shift(json_decode($response));
echo($info->verse ." ");
?>
Answer the question
In order to leave comments, you need to log in
Could you at least describe what exactly does not work.
try playing around with the request headers, User agent, referer, etc.
$opts = [
'http'=> [
'user_agent' => 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0',
]
];
$context = stream_context_create($opts);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question