How to set a header in wp_safe_remote_get()?

This will work

$args = array( 'headers' => array("Accept" => "application/json"));
$file = wp_safe_remote_get('http://xxxxxxxx.xxxx/xapix/xjson/xxxxx.php', $args);

headers is an array. Not a string .