None of the following produce success. In each case, I get
"code": 1012,
"message": "Request must contain one of \"purge_everything\", \"files\", \"tags\", \"hosts\" or \"prefixes\""
In every case, I do have either “purge_everything” or “files”, so the error message is not helping. What am I doing wrong?
[Including “hosts”, and “files” with “url”]
curl -X POST "https://api.cloudflare.com/client/v4/zones/<MY ZONE>/purge_cache"
-H "Content-Type:application/json"
-H "X-Auth-Key:<MY KEY>"
-H "X-Auth-Email:<MY EMAIL>"
--data '{"hosts":["mydomain.com"], "files":[{"url":"https://mydomain.com/my-file.php"}]}'
[Without “hosts”]
curl -X POST "https://api.cloudflare.com/client/v4/zones/<MY ZONE>/purge_cache"
-H "X-Auth-Email:<MY EMAIL>"
-H "X-Auth-Key:<MY KEY>"
-H "Content-Type:application/json"
-H "Origin: https://www.cloudflare.com"
--data '{"files":[{"url":"https://mydomain.com/my-file.php"}]}'
[purge_everything]
curl -X POST "https://api.cloudflare.com/client/v4/zones/<MY ZONE>/purge_cache"
-H "X-Auth-Email:<MY EMAIL>"
-H "X-Auth-Key:<MY KEY>"
-H "Content-Type:application/json"
--data '{"purge_everything":true}'
[purge_everything, with Origin]
curl -X POST "https://api.cloudflare.com/client/v4/zones/<MY ZONE>/purge_cache"
-H "X-Auth-Email:<MY EMAIL>"
-H "X-Auth-Key:<MY KEY>"
-H "Content-Type:application/json"
-H "Origin: https://www.cloudflare.com"
--data '{"purge_everything":true}
[files with { } ]
curl -X POST "https://api.cloudflare.com/client/v4/zones/<MY ZONE>/purge_cache"
-H "X-Auth-Email:<MY EMAIL>"
-H "X-Auth-Key:<MY KEY>"
-H "Content-Type:application/json"
-H "Origin: https://www.cloudflare.com"
--data '{"files":[{"https://mydomain.com/my-file.php"}]}'
[files without { ] ]
curl -X POST "https://api.cloudflare.com/client/v4/zones/<MY ZONE>/purge_cache"
-H "X-Auth-Email:<MY EMAIL>"
-H "X-Auth-Key:<MY KEY>"
-H "Content-Type:application/json"
-H "Origin: https://www.cloudflare.com"
--data '{"files":["https://mydomain.com/my-file.php"]}'
Bonus question - I want to list more than one URL - How to do that? (I also tried several combinations of { } and square brackets but no joy.
TIA