被禁用的文件 https://xxxx/web-pc/images/new_index/pageqrpic.png
帮助文档
https://developer.qiniu.com/kodo/4173/modify-the-file-status
请求的语法
POST /chstatus/<EncodedEntry>/status/<status> HTTP/1.1
Host: rs.qbox.me
Content-Type: application/x-www-form-urlencoded
Authorization: Qiniu <AccessToken>
EncodedEntry
entry = '<Bucket>:<Key>'
encodedEntryURI = urlsafe_base64_encode(entry)
## Bucket:key
xxx-hottie-statics:web-pc/images/new_index/pageqrpic.png
## Base64之后
bG92ZS1ob3R0aWUtc3RhdGljczp3ZWItcGMvaW1hZ2VzL25ld19pbmRleC9wYWdlcXJwaWMucG5n
的细节请参考 EncodedEntryURI。 值为数字,0表示启用;1表示禁用。
调用生成token
Auth.create("xwxJ0TrjG9W9XAax168PmMhhbWmb-KyuS8BFKkXT", "FxQKl6q_v9MxxAxqnuPirmJFcQtDAdk2uhrKrmS5").authorizationV2("http://rs.qbox.me/chstatus/bG92ZS1ob3R0aWUtc3RhdGljczp3ZWItcGMvaW1hZ2VzL25ld19pbmRleC9wYWdlcXJwaWMucG5n/status/0", "POST", null, "application/x-www-form-urlencoded")
生成的token
POST /chstatus/bG92ZS1ob3R0aWUtc3RhdGljczp3ZWItcGMvaW1hZ2VzL25ld19pbmRleC9wYWdlcXJwaWMucG5n/status/0
Host: rs.qbox.me
Content-Type: application/x-www-form-urlencoded
Qiniu xwxJ0TrjG9W9XAax168PmMhhbWmb-KyuS8BFKkXT:UeVvLpdZ-MFrNk9VNa8ZOwq16fE=
com.qiniu.util.StringMap@4845abe5
最后进行调用
hfg@hfg-PC:~$ curl -i \
> -o - \
> -H 'Content-Type: application/x-www-form-urlencoded' \
> -H 'Host: rs.qbox.me' \
> -H 'Authorization: Qiniu xwxJ0TrjG9W9XAax168PmMhhbWmb-KyuS8BFKkXT:UeVvLpdZ-MFrNk9VNa8ZOwq16fE=' \
> -X POST \
> 'http://rs.qbox.me/chstatus/bG92ZS1ob3R0aWUtc3RhdGljczp3ZWItcGMvaW1hZ2VzL25ld19pbmRleC9wYWdlcXJwaWMucG5n/status/0'
HTTP/1.1 200 OK
Server: openresty
Date: Wed, 02 Jun 2021 05:38:42 GMT
Content-Type: application/json
Content-Length: 0
Connection: keep-alive
X-Reqid: HAoAAI3cioRPrYQW
X-Reqid: HAoAAI3cioRPrYQW
X-Log: -
hfg@hfg-PC:~$
curl -i \
-o - \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Host: rs.qbox.me' \
-H 'Authorization: Qiniu xwxJ0TrjG9W9XAax168PmMhhbWmb-KyuS8BFKkXT:UeVvLpdZ-MFrNk9VNa8ZOwq16fE=' \
-X POST \
'http://rs.qbox.me/chstatus/bG92ZS1ob3R0aWUtc3RhdGljczp3ZWItcGMvaW1hZ2VzL25ld19pbmRleC9wYWdlcXJwaWMucG5n/status/0'