Introduction
Statistics
Contact
Development
Disclaimer
Help
box.matto.nl home page
+++ Monday 26 May 2025 +++
Multi-line toots with curl
==========================
Tooting from the command line
-----------------------------
Tooting from the command line with curl is efficient.
No need to start a client or to write in a browser form.
In general, the command is:
curl -X POST https://<instance-url>/api/v1/statuses \
--header "Authorization: Bearer <long-key>" -d "status=<toot message>"
Multi line toot
---------------
To incorporate newlines in the toot message, we have to write the command
a little bit different:
curl -X POST https://<instance-url>/api/v1/statuses \
--header "Authorization: Bearer <long-key>" -d $'status=<toot\nmessage\nand more>'
With this syntax, the `\n'-tokens will be replaced by a new line.
Happy tooting!
Last edited: $Date: 2025/05/26 19:21:10 $