如何将%2f传递到java.net.URI,而不将其转换为/
我使用Scala的Dispatch,如下所示:如何将%2f传递到java.net.URI,而不将其转换为/,java,scala,rabbitmq,url-encoding,scala-dispatch,Java,Scala,Rabbitmq,Url Encoding,Scala Dispatch,我使用Scala的Dispatch,如下所示: val body = """{"count":5,"requeue":true,"encoding":"auto","truncate":50000}""" val req = url("http://localhost:4567/api/queues/%2f/myQueue/get").as_!("guest", "guest") << (body, "application/json") val http = new Http
val body = """{"count":5,"requeue":true,"encoding":"auto","truncate":50000}"""
val req = url("http://localhost:4567/api/queues/%2f/myQueue/get").as_!("guest", "guest") << (body, "application/json")
val http = new Http
val resp = http(req as_str)
val body=“”{“count”:5,“requeue”:true,“encoding”:“auto”,“truncate”:50000}”
val req=url(“http://localhost:4567/api/queues/%2f/myQueue/get)如!!(“guest”,“guest”)%符号用于url编码。所以,%2f被解码成/。在浏览器上试用,您将看到
使用%25表示%符号。e、 g
val req = url("http://localhost:4567/api/queues/%252f/myQueue/get")
将其转换为/api/queues/%252f/cdm.mio/get
,而不是/api/queues/%2f/cdm.mio/get
:(这很有趣。%2f被解码,但%25不被解码,两者都有效。这可能是相关问题吗?