Closed ludaavics closed 5 years ago
Please, try to follow example under tests to add example request fixture for the parsmeters support and then update snapshots-file if the output is correct (I don’t remember that by heart).
The actual implementation can be messy as long as its output is tested.
FYI, I couldn't get the snapshot tests to work on my mac. It looks like the output of this line may be slightly platform dependent? I get almost the same results, but with some extra whitespace, as well as extra commas in data structures (e.g. {'k1': 'v1', 'k2': 'v2', }
vs {'k1': 'v1', 'k2': 'v2'}
in your snapshots).
To be clear, the resulting commands are equivalent, but the string representations are different, causing a bunch of failures.
Conversely, I had to manually edit the snapshot file instead of generating it automatically.
@ludaavics I'll merge this and create a release for you. Thanks for reporting the issue about requests builder generating platform dependent results. Need to check that on some day.
Summary
Add support of the URL query parameters, using the
query
field. Given a line:query param_name: param_value
in an http example directive, the key value pairparam_name
,param_value
will be added to the request URL (and excluded from further processing).See issue #35
Examples
is equivalent to
For list parameters, pass the same field multiple times:
Finally, any parameters in the original query will be preserved: