httpretty

Is there an alternative to parse_qs that handles semi-colons?

无人久伴 提交于 2019-12-09 13:37:03
问题 TL;DR What libraries/calls are available to handle query strings containing semi-colons differently than parse_qs? >>> urlparse.parse_qs("tagged=python;ruby") >>> {'tagged': ['python']} Full Background I'm working with the StackExchange API to search for tagged questions. Search is laid out like so, with tags separated by semi-colons: /2.1/search?order=desc&sort=activity&tagged=python;ruby&site=stackoverflow Interacting with the API is just fine. The problem comes in when I want to test the

Is there an alternative to parse_qs that handles semi-colons?

坚强是说给别人听的谎言 提交于 2019-12-03 15:22:17
TL;DR What libraries/calls are available to handle query strings containing semi-colons differently than parse_qs? >>> urlparse.parse_qs("tagged=python;ruby") >>> {'tagged': ['python']} Full Background I'm working with the StackExchange API to search for tagged questions. Search is laid out like so, with tags separated by semi-colons: /2.1/search?order=desc&sort=activity&tagged=python;ruby&site=stackoverflow Interacting with the API is just fine. The problem comes in when I want to test the calls, particularly when using httpretty to mock HTTP. Under the hood, httpretty is using urlparse.parse