Tried to address awkward API issue when append query parameters. #82
+150
−113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking changes in the uri_builder interface.
The report in #61 is correct in that the interface is awkward and confusing. It was also buggy (encoding didn't happen correctly).
I fixed the encoding issue, and explicitly renamed the functions to:
append_query
append_query_key_value_pair
Although this is a bit more verbose, it removes the element of inconsistency. I would be open to renaming these functions, if there are better names.
Finally, to address the commentary in #61:
"I struggle to think of a use case where, when using uri_builder, I would want to undo a previous call to query by replacing its result with a subsequent call to query"
I agree, but in the very unlikely event that someone needs this, they can simply call "clear_query" before starting again.