Postman Cloudflare API collection

API-for-dummies
#1

Hi,

I’m for the first time stepping my feet onto the cold waters of API usage, and just today I downloaded this super cool app Postman, for which Cloudflare has a prepared list (or “collection”) of requests here.

I’ve set a few requests for purging the generated HTML pages of my websites. I did so by including the whole list extracted from each site’s sitemap.xml file. But now I just came across the part of the API documentation about purging individual files, and it has the following examples:

[
  "http://www.example.com/css/styles.css",
  {
    "url": "http://www.example.com/cat_picture.jpg",
    "headers": {
      "Origin": "cloudflare.com",
      "CF-IPCountry": "US",
      "CF-Device-Type": "desktop"
    }
  }

]

My question concerns the second example. Is it asking to purge cat_picture.jpg, but only if it was served with the above specified headers? Or are the headers by themselves a separate purge request???

Also, I was a bit intrigued by seeing POST on the API doc, but DEL on Postman for purge requests. I guess this is something that I can totally ignore, but you never know.

Thanks

0 Likes