Uri(...).withQuery("a" -> "POST /api") Not Encoding `/` in `/api`

14 views
Skip to first unread message

Kevin Meredith

unread,
Apr 30, 2016, 11:04:42 PM4/30/16
to spray.io User List

scala> Uri("http://a.b.c/a").withQuery("a" -> "POST /api")

res2: spray.http.Uri = http://a.b.c/a?a=POST+/api


Shouldn't the slash in front of 'api' be encoded with `%2F`?


Example:


scala> java.net.URLEncoder.encode("POST /api", "UTF-8")

res6: String = POST+%2Fapi

André

unread,
May 1, 2016, 6:37:35 PM5/1/16
to spray.io User List
Slashes in Queries should be OK. See https://tools.ietf.org/html/rfc3986#section-3.4
Reply all
Reply to author
Forward
0 new messages