News for hackers. Stuff that matters.
Re:The time might come when we add some JSON specific comman... by darrenf on Thursday January 20, 2022 @02:12PM (#30013260)
For longer than I can recall I've had a `post_json` alias like this:

    curl -H'Content-Type: application/json' -d @- << 'JSON'
Invoke with

    post_json <url>
Then just paste or write JSON without caring about quotes etc, finish the heredoc, done.
Re:The time might come when we add some JSON specific comman... by paledot on Thursday January 20, 2022 @10:27PM (#30018775)
TIL you could open (and not close) a heredoc string in an alias.
Re:The time might come when we add some JSON specific comman... by tomsmeding on Thursday January 20, 2022 @02:24PM (#30013457)
Don't you need `<<'JSON'` instead of `<<JSON`? Otherwise any $ in the json body would be interpreted as a shell variable reference.
Re:The time might come when we add some JSON specific comman... by darrenf on Thursday January 20, 2022 @03:04PM (#30013969)
Yes, I mistyped on my phone. Edited, thanks!