我正在使用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 resp = http(req as_str)
%2f
会被转换成 /
,所以它试图将数据提交到 /api/queues///myQueue/get
而不是 /api/queues/%2f/myQueue/get
。要如何正确地进行转义?