Last active
January 18, 2023 19:29
-
-
Save mlegls/478c11fbc19aeddb66a25d365d0a58ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ ngn/k | |
\d http | |
s:{$[`C=@x;x;$x]} / string | |
qs:{"'",(s x),"'"} / quote string | |
cp:{$[1~#p:$x;"-",p;"--",p]} / command param | |
c:{" "," "/(cp'!x),'" ",'qs'.x} / cp list | |
q:{"?","&"/($!x),'"=",'s'.x}. / dict -> qstring | |
gr:{."\\curl -Gs ",qs x} / GET raw | |
g:{gr x,(q y)} / GET[url;qs] | |
pr:{."\\curl -s -X POST ",(qs x),c y} / POST[url;args], e.g. pr["a.com";`user`T!("u:pass";"d.txt")] | |
p:{pr[x;`H`d!("Content-Type: application/json";`j@y)]} / json POST[url;data] | |
\d . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment