jonathonmcmurray / reQ

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

Improve usability of .req.post #7

Closed jonathonmcmurray closed 3 years ago

jonathonmcmurray commented 6 years ago

Currently it's a little cumbersome to pass e.g. a JSON body to a request. We should accept something like

.req.post[url;`json;`a`b`c!1 2 3]

to auto-convert to JSON & put correct Content-Type

Need to consider how it should work with custom headers required as well

jonathonmcmurray commented 6 years ago

Possibly something like

.req.post[url;()!();(`json;`a`b`c!1 2 3)]

Would be better to allow for custom headers, & could have a .req.p projection with no custom headers, similar to .req.g