sendgrid / python-http-client

Twilio SendGrid's Python HTTP Client for calling APIs
https://sendgrid.com
MIT License
125 stars 101 forks source link

Can't support the same query parameter twice in one URL #79

Closed pkkim closed 6 years ago

pkkim commented 6 years ago

Issue Summary

As far as I can tell, this library doesn't let you make requests to URLs which use the same query parameter key more than once, such as http://example.com?bar=foo&bar=baz. This is a problem because many HTTP APIs use this pattern, including SendGrid's own v3 endpoint /subusers/reputations. It might be good if you could pass either a dict or a list of two-tuples.

Steps to Reproduce

Look at python_http_client.client.Client._build_url. query_params is expected to be a dict, or at least something on which you can call items.

Technical details:

thinkingserious commented 6 years ago

Thanks for reporting this @pkkim!

I have added this to our backlog.

For this issue to gain priority in our backlog, we need additional +1's or a PR. When we receive a PR, that provides the biggest jump in priority.

pkkim commented 6 years ago

Sorry, I was mistaken about this. In fact, passing query_params={'a': [1, 2]} actually does produce a URL with query parameters ?a=1&a=2. Whoops.

thinkingserious commented 6 years ago

No worries @pkkim. Thanks for following up!