Upyun Refreshing cached signatures I don't know what's wrong.

Source: Internet
Author: User
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);} 

$pathThe following add \n , like:http://www.xx.com/a/b.jpg\n

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.