This snippet will grab a JSON formatted resource, decode it and print it in PHP array format.
// Fetch
$response = wp_remote_get( 'http://www.example.com/resource.json' );
if ( ! is_wp_error( $response ) ) {
$headers = wp_remote_retrieve_headers( $response );
if ( isset( $headers[ 'content-type' ] ) && 'application/json' === $headers[ 'content-type' ] ) {
print_r( json_decode( wp_remote_retrieve_body( $response ) ) );
}
}