gpt4 book ai didi

ruby - httparty:如何记录请求?

转载 作者:数据小太阳 更新时间:2023-10-29 06:28:23 25 4
gpt4 key购买 nike

如何记录使用 httparty 发送的请求?

HTTParty.post(
@application_url,
:headers => {
"Accept" => "application/json",
"Content-Type" => "application/json; charset=utf-8"
},
:body => {
"ApplicationProfileId" => application.applicationProfileId
}.to_json
)

最佳答案

使用debug_output在类里面:

class Foo
include HTTParty
debug_output $stdout
end

或根据要求

response = HTTParty.post(url, :body => body, :debug_output => $stdout)

关于ruby - httparty:如何记录请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22414803/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com