When base_url contains query parameters (e.g. "https://example.com/get?data=1"),
_enforce_trailing_slash() appended "/" to raw_path which includes the query string,
corrupting "?data=1" into "?data=1/". Similarly, _merge_url() concatenated paths
without separating the query string from the path component.
Fix both methods to split raw_path at "?" before manipulating the path, then
rejoin with the query string intact.
Fixes#3614
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>