twilio-python
twilio-python copied to clipboard
URL encode request params
Version: 6.0.0rc12 API Subdomain (api/taskrouter/ip_messaging): lookups
Code Snippet
number = client.lookups.phone_numbers("+4402077651182").fetch()
number = client.lookups.phone_numbers("(510) 867-5309").fetch()
Request are not URL encoding parameters. The above snippets will produce the requests:
GET: lookups.twilio.com/v1/PhoneNumbers/+4402077651182 -> (+ will be miss misinterpreted)
GET: lookups.twilio.com/v1/PhoneNumbers/(510) 867-5309 -> (invalid URL)
Legacy libraries and at least PHP next-gen do encode params.
This is done.