gpt4 book ai didi

playframework-2.0 - playframework 获取 play.api.libs.ws.WS.WSRequest 的 URL + queryString

转载 作者:行者123 更新时间:2023-12-04 04:33:17 25 4
gpt4 key购买 nike

我有这个要求:

  WS.url("https://maps.googleapis.com/maps/api/directions/json")
.withQueryString(
"origin" -> Seq(oLa, oLn).mkString(","),
"destination" -> Seq(dLa.toString, dLn.toString).mkString(","),
"sensor" -> "false",
"key" -> "IzaSyBAFWRgLWNKIEB2xCdm11ilCfzyVxJ2dasNw"
).get

我想查看“原始”URL + queryString,

这篇文章建议使用wireshark:

https://groups.google.com/forum/#!msg/play-framework/bm_pf3uhcbY/XTzP0d36gKgJ

碰巧我在 SSL 下...

最佳答案

这是方法:

import play.api.libs.ws.ahc.AhcWSRequest

val ahcRequest = req.asInstanceOf[AhcWSRequest].buildRequest()
Logger.debug("Uri: " + ahcRequest.getUri)

play 2.6 更新:
import play.api.libs.ws.ahc.AhcWSRequest

val ahcRequest = req.asInstanceOf[AhcWSRequest]
Logger.debug("Uri: " + ahcRequest.uri)

关于playframework-2.0 - playframework 获取 play.api.libs.ws.WS.WSRequest 的 URL + queryString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20200939/

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