C
C
Cucumber2017-03-25 17:14:54
PHP
Cucumber, 2017-03-25 17:14:54

I can not get the correct content of the json file through curl, what's the problem?

Here is the content to get
185.97.254.83:10000/recent.json
Here is how to get it:

$c = curl_init('http://185.97.254.83:10000/recent.json');
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_TIMEOUT, 10);
$obj = curl_exec($c);
var_dump($obj);

Here is the result:
daf6f50641f24a63a2feeb639ff21b72.png
The smaller file is loaded correctly ( 212.22.93.227:38025/recent.json ), I can't figure out what the problem is.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2017-03-25
@farrewa906

Because gzip.
curl_setopt($c, CURLOPT_ENCODING, "gzip");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question