該應用程式允許限制外部連結共享的下載數量。
下面的範例可以使用 hurl 來運行。
提示
若要忽略斷言,請傳遞--ignore-asserts
標誌。
外部共用限制可以透過其令牌查詢。
hurl get.hurl --variable token='2Nyq27RKT7Jw9q3'
獲取.hurl
GET https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/{{token}}/limit
OCS-APIRequest: true
Accept: application/json
[BasicAuth]
alice: alice
HTTP 200
[Asserts]
jsonpath "$.ocs.data.limit" exists
jsonpath "$.ocs.data.count" exists
hurl propfind.hurl --變數擁有者=admin --變數路徑=/welcome.txt
propfind.hurl
PROPFIND https://nextcloud.local/remote.php/dav/files/{{owner}}/{{path}}
[BasicAuth]
{{owner}}: {{owner}}
```xml
```
HTTP 207
[Asserts]
xpath "//nc:share-download-limits" isCollection
hurl set.hurl --變數標記='2Nyq27RKT7Jw9q3' --變數限制=5
設定.hurl
PUT https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/{{token}}/limit
OCS-APIRequest: true
Accept: application/json
[BasicAuth]
alice: alice
{
"limit": {{limit}}
}
HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty
hurl remove.hurl --variable token='2Nyq27RKT7Jw9q3'
刪除.hurl
DELETE https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/{{token}}/limit
OCS-APIRequest: true
Accept: application/json
[BasicAuth]
alice: alice
HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty
管理員可以設定預設限制。
hurl set-default.hurl --變數限制=1
設定預設值.hurl
PUT https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/limit
OCS-APIRequest: true
Accept: application/json
[BasicAuth]
admin: admin
{
"limit": {{limit}}
}
HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty