Object to query string
You have neglected to escape your keys and values. If any of the data contains a special character such as &amp;, the generated URL will be wrong.

To perform the escaping, I recommend calling encodeURIComponent().