Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我看到了这个问题,但这不是很时髦!我只是想知道 HttpClient 请求闭包中是否有一种简单的方法可以打印出正在发送的请求?此信息在代码中有些可用,但如果我可以将其输入到日志文件中,它将真正有助于开发。
该代码可以转换为这个 groovy:
request.allHeaders.each { println "${it.name} : ${it.value}" }