avatar

loweryt

Zone Settings, Cloudflare API

Recently I was trying to figure out how to use Cloudflare’s API to update the minimum TLS version across many domains in a Cloudflare account quickly. The request curl sample provided by Cloudflare for Edit zone setting didn’t include a data option (-d / –data), so I wasn’t sure how to package the values required in the PATCH request. # Cloudflare request sample: Shell / cURL curl --request PATCH \ --url https://api.cloudflare.com/client/v4/zones/zone_id/settings/setting_id \ --header 'Authorization: Bearer undefined' \ --header 'Content-Type: application/json' Initially I thought the data payload might have needed to be a dictionary with the actual name of the zone setting as the key, e.g. { ‘zone_setting’: ‘value’ }, but this resulted in the following error:

first

i’ve been wanting to put a blog together for a while. to share things i’ve learned, where i’ve learned them, etc. drawings, thoughts, celebrations. i think i’ll also use it as a journal.