Wordpress 文件\u获取\u内容正常,但wp\u远程\u获取失败

Wordpress 文件\u获取\u内容正常,但wp\u远程\u获取失败,wordpress,Wordpress,它看起来像是WordPress客户端的服务器过滤器。如果更改用户代理,它将工作: //$url = 'http://www.mysteryranch.com/Product%20Images/WS17%20Triple%20Bang%20Pouch_10-multicam-hero.jpg'; $url = 'http://www.mysteryranch.com/Product Images/WS17 Flash Bang Pouch_20-multicam-open.jpg';

它看起来像是WordPress客户端的服务器过滤器。如果更改用户代理,它将工作:

//$url = 'http://www.mysteryranch.com/Product%20Images/WS17%20Triple%20Bang%20Pouch_10-multicam-hero.jpg';
  $url = 'http://www.mysteryranch.com/Product Images/WS17 Flash Bang Pouch_20-multicam-open.jpg';

              // $url = str_replace( " ", '%20', $url );

                //$response = file_get_contents($url);
                //echo '<pre>';print_r($response);exit;
                $response = wp_remote_get($url );
                echo '<pre>';print_r($response);exit;
$response = wp_remote_get($url, [
    "user-agent" => "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0",
]);