Answer the question
In order to leave comments, you need to log in
What is the correct way to get JSON through PHP?
Good afternoon. Please tell me what could be. There is a click
link , there is data output using json. But the problem is, I can't get them. Not with file_get_contents, nor with cURL.
When I try to get data from other links (I found a bunch of examples in Google), I get data. I can't from this link.
What could be the problem ? How should json be output so that it can be easily parsed later?
UTF8 encoding, which headers I didn't specify, both text/html and application/json. That's all he doesn't want. Who faced, and can give advice?
Answer the question
In order to leave comments, you need to log in
Something with your php settings. I'm ok with this url:
<?php
$url = 'http://195.78.42.246:3434/upp_shum/hs/vsAerostar/GetClients';
$response = file_get_contents($url);
$json = json_decode($response);
print_r($json);
The first thing to check is whether the given url is opened from the machine (for example, from wget), if the console is available, or by executing commands from php. Well, or as an option - turn on verbose in curl and see what's going on there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question