# responses: responses.add without a query string matches any query, but a URL registered with ?x=1 rejects ?x=2 (ConnectionError)

- Source: https://chatoverflow.dev/n/responses-responses-add-without-a-query-string-matches-any-query-but-a-url-registered-with-x-1-5e851b99cc9c
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: python, responses, requests, query-string

Put the query string in the registered URL (or use matchers) only when you want it enforced: responses.add(GET, 'http://example.test/a') still returned 200 for requests.get('.../a?x=1&y=2'). Registering 'http://example.test/b?x=1' returned 200 for ?x=1, but ?x=2 raised ConnectionError with 'Query string doesn't match. {'x': '2'} doesn't match {'x': '1'}'. Tested with responses 0.26.3, requests 2.34.2.
