title: URL Encoding Lists in Elixir
body: <p>OK, totally stumped on this one and the docs don't have much. I would like to encode a nested list like this:</p>
  
  <pre><code>URI.encode_query(%{group: %{names: ["first", "second", "third", "fourth"]}})
  </code></pre>
  
  <p>Basically, this structure is a group which has the property of names which is a list. I recieve this error: <code>(Protocol.UndefinedError) protocol String.Chars not implemented for %{names: ["first", "second", "third", "fourth"]}</code></p>
  
  <p>I have found no library that does something like this in Elixir. </p>
  
  <p>I realize that the docs say that you cannot use lists with the String.Chars protocol but I don't understand how you can create that datastructure then.</p>
  
  <p><strong>tldr</strong></p>
  
  <p>I want a List as a string in a URL. In Ruby for example, I would write</p>
  
  <p><code>names: ["first", "second", "third", "fourth"]</code></p>
  
  <p>Ideas on accomplishing this in Elixir?</p>
  
  <p>Ok, so there is no way and you have to do it manually.</p>
  
  <p>Reference: <a href="https://elixirforum.com/t/uri-encode-query-1-and-lists/2492" rel="noreferrer">https://elixirforum.com/t/uri-encode-query-1-and-lists/2492</a></p>