Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $USERAGENT = "Please change this!";
- $REQUEST_URL = "https://api.spiget.org/v2/resources/12345";
- $options = array('http' => array('user_agent' => $USERAGENT));
- $context = stream_context_create($options);
- $response = @file_get_contents($REQUEST_URL, false, $context);
- if(!isset($response) || is_null($response)) {
- // error handling
- }
- $data = json_decode($response, true);
- // TODO: process data
- print_r($data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement