我希望使用Kickbox的api打印API调用的响应。
这就是我所拥有的
require "kickbox"
client = Kickbox::Client.new('XXXXXXXXXXXXXXXXXXXXXXXXXXXX')
kickbox = client.kickbox()
response = kickbox.verify("test@example.com")
puts response
尝试在终端中运行文件时,我没有得到任何响应。
答案 0 :(得分:1)
尝试response.body
{
"result" =>"unknown",
"reason" =>"no_connect",
"role" =>true,
"free" =>false,
"disposable" =>false,
"accept_all" =>false,
"did_you_mean" =>nil,
"sendex" =>0.35,
"email" =>"test@example.com",
"user" =>"test",
"domain" =>"example.com",
"success" =>true,
"message" =>nil
}
您还可以从response.headers
{
"content-type" =>"application/json",
"x-kickbox-balance" =>"99",
"x-kickbox-response-time"=>"17"
}