Closed adhocore closed 7 months ago
I would also love this feature!
@rakyll what do you think? Found some related issues, but for request query parameter: https://github.com/rakyll/hey/issues/35, https://github.com/rakyll/hey/pull/183
i think it is neat and uniform to make query args and path uri dynamic in the same way and semantics as the body payload. a POC that I am working on is looking great, pushing it asap. i hope this will resolve all dynamic issues once and for all
but getting it merged might be difficult
is this live?
@Ojasv-Singh-Zeotap it isn't merged yet so no live
(seems it won't be ever so closing this PR for good, i was thinking of doing something of my own but can't afford to invest any more time) PS: if you are interested you can carry over my PR and maintain it somewhere else
Sadly, I believe these changes will never be merged. However, I found them so useful that I forked the project and added them to my fork. Thanks for your work, @adhocore!
Docs in README.md Tests in
requester/generator_test.go
I use hey and needed a way to send dynamic payload (request body) to endpoint so this is the hack that I thought maybe useful to contribute.
While the docs and tests are based on JSON payload, it is agnostic of content type - all that matters is the placeholders are in the body template and it will be dynamically interpolated. The generator is activated only once at the start only if the body template contains at least one placeholder so otherwise it won't get in the way.
(PS: while at it i have refactored the deprecated ioutil usage)