title: Adding Query string params to a Guzzle GET request?
body: <p>I read <a href="https://stackoverflow.com/questions/12283075/building-query-string-progammatically-in-guzzle">this answer</a> but I believe there is a better way to create a http url query in Guzzle, I am looking for something like this, but cannot get it to work correctly, nor do I know if there is a way to dump the url string to see if it is processing correctly. Could someone show me the correct way to do this?</p>
  
  <pre><code>// works correctly
  $client = New GuzzleHttp\Client();
  $request = $client-&gt;get('http://192.168.50.8/foo?-db=database&amp;-lay=layout&amp;-find');
  print_r($request-&gt;getBody());
  </code></pre>
  
  <p>Does not work</p>
  
  <pre><code>$request = $client-&gt;get($config-&gt;Layout['server'], [], [
          'query' =&gt; [
              $config-&gt;Layout['switches'], // ([ '-db' =&gt; 'database', '-lay' =&gt; 'layout', '-find' =&gt; true)
              $config-&gt;Layout['options'], // other params
          ]
  ]);
  </code></pre>