The result returned is 401 sign error
Public Function Delete ($path) {//For example http://www.xx.com/a/b.jpg, I pass the deletion is/a/b.jpg//Delete part skip//flush cache start $ch = curl_i NIT (' http://purge.upyun.com/purge/'); $date = Gmdate (' d, D M Y h:i:s \g\m\t '); Sign here, I'm a direct $path, I suspect it's wrong here, but I've tried http://www.xx.com in front, and it's still a mistake $sign = MD5 ($path. & '. $this->bucket. ' & '. $date. ' & '. MD5 ($this->password)); Header information $header = Array (' Expect: "', ' Authorization:upyun '. $this->config[' buckets '). ': ' $this->con fig[' username ']. ': '. $sign, ' Date: '. $date, ' content-type:application/x-www-form-urlencoded ',); curl_setopt ($ch, Curlopt_httpheader, $header); POST mode curl_setopt ($ch, curlopt_post,1); This is also a problem, I do not know whether to submit the past $data = Array (' Purge ' = UrlEncode ($path),); curl_setopt ($ch, Curlopt_postfields, $data); Whether to return header information curl_setopt ($ch, curlopt_header,1); $response = curl_exec ($ch); $status = Curl_getinfo ($ch, Curlinfo_http_code); Curl_close ($ch); Print result Var_dump ($response);}
Reply content:
The result returned is 401 sign error
Public Function Delete ($path) {//For example http://www.xx.com/a/b.jpg, I pass the deletion is/a/b.jpg//Delete part skip//flush cache start $ch = curl_i NIT (' http://purge.upyun.com/purge/'); $date = Gmdate (' d, D M Y h:i:s \g\m\t '); Sign here, I'm a direct $path, I suspect it's wrong here, but I've tried http://www.xx.com in front, and it's still a mistake $sign = MD5 ($path. & '. $this->bucket. ' & '. $date. ' & '. MD5 ($this->password)); Header information $header = Array (' Expect: "', ' Authorization:upyun '. $this->config[' buckets '). ': ' $this->con fig[' username ']. ': '. $sign, ' Date: '. $date, ' content-type:application/x-www-form-urlencoded ',); curl_setopt ($ch, Curlopt_httpheader, $header); POST mode curl_setopt ($ch, curlopt_post,1); This is also a problem, I do not know whether to submit the past $data = Array (' Purge ' = UrlEncode ($path),); curl_setopt ($ch, Curlopt_postfields, $data); Whether to return header information curl_setopt ($ch, curlopt_header,1); $response = curl_exec ($ch); $status = Curl_getinfo ($ch, Curlinfo_http_code); Curl_close ($ch); Print result Var_dump ($response);}
$path
The following add \n
, like:http://www.xx.com/a/b.jpg\n