title: Valid query parameters - passing data in URL
body: <p>Each time I needed query params to be allowed in the URL I've always used <code>http://example.com?something=value&amp;else=value</code>. </p>
  
  <p>However, recently I needed to convert a JSON object into a query parameter in URL to look like this <code>key=value&amp;key2=value2</code> to be passed in the URL and my colleague asked me why would I use such technique to convert an object in the URL rather than having the same JSON object stringified and inserted in the URL directly like the following: <code>http://example.com?data='{"key":"value", "key2:"value2"}'</code></p>
  
  <p>Whilst my colleague's suggestion looks very ugly to me I could not really provide him an answer more than that most websites pass parameters using <code>http://example.com?something=value.</code> practise over his recommendation.</p>
  
  <p>if I use query parameters technique <code>?key=value</code> I can benefit from Javascript's built-in features like <code>URLSearchParams</code> to use the data passed in the URL.</p>
  
  <p>With my colleague's recommendation, I could simply convert the string back to an object and query what was a URL with features found in objects.</p>
  
  <p>What are the drawbacks of each method and why should I use one over the other?</p>