1. Qiniu crawls third-party resources and always returns 404 Third-party resources not found
2. This is the crawling part code I wrote, using the Qiniu class that comes with thinkphp3.2
//Third-party resource capture
public function fetch($url, $key)
{
$url = self::Qiniu_Encode($url);
$request_url = "http://iovip.qbox.me/fetch/{$url}/to/" . self::Qiniu_Encode("{$this->bucket}:{$key}");
$accessToken = $this->accessToken($request_url);
$response = $this->request($request_url, 'POST', array('Content-Type:' => 'application/x-www-form-urlencoded', 'Authorization' => "QBox $accessToken "));
return $response;
}
3. Fetched resources: https://www.baidu.com/img/bd_...
4. The error message returned: [HTTP/1.1 404 Not Found]:Not Found]"
I found the problem. The host provided by Qiniu official website is: iovip.qbox.me. This host can no longer be used as a resource crawler. It has been changed to iovip-z2.qbox.me. This is the host in Qiniu PHP SDK. After replacement It can be used normally. No problem