setQueryParameters removes/overrides parameters set in url string

45 views
Skip to first unread message

Joseph Conley

unread,
Apr 17, 2015, 8:34:22 PM4/17/15
to dispatc...@googlegroups.com
When building a request with a url which already has query parameters in the url string, the setQueryParameters method removes all parameters from the url string and replaces it with that methods arguments.  For example:

var url1 = "http://example.com?id=1&name=Joe"

//removes id and name parameters, only sends the age parameter
var req1 = dispatch.url(url1).setQueryParameters(Map("age" -> Seq(21)))


var url2 = "http://example.com?id=1&name=Joe&age=21"

//removes ALL query params from above
var req2 = dispatch.url(url2).setQueryParameters(Map.empty[String, Seq[String]])

Please advise.

Thanks,
Joe

Thomas Christensen

unread,
Apr 18, 2015, 3:09:56 AM4/18/15
to dispatc...@googlegroups.com

Can you plese take me of the mailing list. I havn't programmed scala for almost two years now.

> --
> You received this message because you are subscribed to the Google Groups "Dispatch" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dispatch-scal...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Tagir Magomedov

unread,
Jul 6, 2015, 5:58:07 PM7/6/15
to dispatc...@googlegroups.com
you can use <<? operator to append parameters

dispatch
.url(url1) <<?
Map("age" -> Seq(21))
Reply all
Reply to author
Forward
0 new messages