Quantcast
Channel: Akka Libraries - Discussion Forum for Akka technologies
Viewing all articles
Browse latest Browse all 1362

Uri.Query space character encoding

$
0
0

Hi!
I’m not sure if this is bug, so I’ve decided to post it here first before raising issue on Github.
I often use Uri with Query class to create request URL. Code example:

val uri = Uri("http://localhost:9000")
  .withQuery(Uri.Query(
     "param" -> "value with spaces"
  ))

Http().singleRequest(RequestBuilding.Get(uri))
// rest of the code

The problem is that Akka sends request with spaces encoded as ‘+’, which is later not recognized by server as space, but as just plain ‘+’ sign. So request URL in above example will be: “http://localhost:9000?param=value+with+spaces”.
Shouldn’t spaces be encoded as ‘%20’ in query parameters?

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1362

Trending Articles