I'm using the excellent Dispatch library to make HTTP requests like so:
Http(url("http://foo.bar/baz").GET <<? Map("param1" -> "value1") OK as.String)
However, I'm talking to a REST service that expects param1
to be a list of values. How can I accomplish this in Dispatch?
I see in the source code that <<?
takes a Traversable[(String,String)]
, so maybe it is as easy as passing a Traversable
that allows keys to appear multiple times. Is there such a beast? I've been poking through the Scala API docs, but I can't find one that would seem to fit the bill.
Failing that, is there a way to hook into the request builder? I see that Dispatch uses a com.ning.http.client.RequestBuilder
, on which I could call addQueryParameter()
myself.