require 'httparty'
require 'json'
response = HTTParty.delete("https://api.cloudflare.com/client/v4/zones/5746746785687568678785/purge_cache",
:headers => { "X-Auth-Email" => "myemail@company.com" , "X-Auth-Key" => "7456785476856789567965","Content-Type" => "application/json" } ,
:body => {:"purge_everything" => "true"}.to_json
)
puts response.body, response.message
我一直接受purge_everything必须设置为true作为回应。有什么想法吗?
答案 0 :(得分:4)
您的Ruby代码看起来没问题,您只为true
参数的"true"
输错了错误。
根据Cloudflare's API docs,JSON应该看起来像purge_everything
。