In Scala how do I build up a URL with query string parameters programmatically?
Also how can I parse a String
containing a URL with query string parameters into a structure that allows me to edit the query string parameters programmatically?
Spray has a very efficient URI parser. Usage is like so:
import spray.http.Uri
val uri = Uri("http://example.com/test?param=param")
You can set the query params like so:
uri withQuery ("param2" -> "2", "param3" -> 3")