jonathonmcmurray / reQ

HTTP requests library in kdb+/q
http://jmcmurray.co.uk/reQ/
MIT License
38 stars 9 forks source link

allow query dict as an optional 2nd element of the URL list #34

Closed danielkrizian closed 3 years ago

danielkrizian commented 3 years ago

Greetings. Would you consider extending the .req.send interface to accept query as a parameter? example[1]

.req.get[;()!()] "https://localhost:5000/v1/api/trsrv/stocks/?symbols=AAPL%2CTWC"   / current
.req.get[;()!()] ("https://localhost:5000/v1/api/trsrv/stocks";enlist[`symbols]!enlist ","sv string `AAPL`TWC)   / proposed in this PR

This would facilitate constructing query parameters dynamically leveraging the kdb dictionary and the existing utilities like .url.format, instead of requiring the user to fiddle with the query string construction themselves ( the ?symbols=AAPL%2CTWC part in the example)

[1] https://interactivebrokers.github.io/cpwebapi/swagger-ui.html