title: Dart URI: multiple query parameters with the same key
body: <p>I'm using <a href="https://developer.mapquest.com/documentation/directions-api/" rel="nofollow noreferrer">Mapquest directions API</a> and my goal is to create a route between a bunch of map points (3 and more).</p>
  
  <p>Here is the API spec for "to" parameter <a href="https://developer.mapquest.com/documentation/directions-api/route/get/" rel="nofollow noreferrer">of the endpoint that's used to fetch a route for a given set of points</a> (it corresponds to the destination):</p>
  
  <blockquote>
    <p>When the input format is key/value pairs, the ending location(s) of a Route Request. More than one to parameter may be supplied. This is used for single-line addresses only.</p>
    
    <p>Refer to the Locations documentation on how to properly form locations in all formats, including JSON and XML.</p>
  </blockquote>
  
  <p>AFAIK it means that multiple "to" parameters can be specified for a query, e.g. "<a href="http://www.mapquestapi.com/directions/v2/route?from=40.65,73.95&amp;to=40.87,-73.85&amp;to=40.70,-73.56" rel="nofollow noreferrer">http://www.mapquestapi.com/directions/v2/route?from=40.65,73.95&amp;to=40.87,-73.85&amp;to=40.70,-73.56</a> . Am I right about this?</p>
  
  <p>So assuming that I understood the spec right, I need to construct an appropriate <a href="https://api.dartlang.org/stable/2.2.0/dart-core/Uri-class.html" rel="nofollow noreferrer"><code>URI</code></a> instance that will be dispatched to the http's library <code>get</code> method. The problem is that it receives a <code>Map&lt;String, String</code> of query parameters in the constructor, and map means uniqueness. How can I construct such a request using <code>URI</code> class?</p>
  
  <p>I've tried to make a workaround by just retrieving a string representation of an <code>URI</code> instance without specifying the <code>to</code> key-value pair and just writing the concatenated <code>to</code>-s in the end of the string with subsequent passing to the <code>http.get</code>. What I missed is that <code>URI</code> takes care for characters' escaping, and writing such a thing by myself seems to be completely inappropriate when the SDK already provides me with <code>URI</code> class.</p>