Is there a way to create a gist using curl
and the Github gist REST API, so that a binary file can be uploaded (for example and image file, or a zip)? I'm mainly interested in being able to upload an SVG file, but I'm also curious as to how it should look for a PNG, or JPEG. I have the following code so far, which works fine for text files:
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${GITHUB_TOKEN"} \
https://api.github.com/gists \
-d '{"description":"test-repo-issue-123-20220811-221420","public":false,"files":{"README.md":{"content":"This is a text file."}}}'
But... how would one pass a binary file here? How does it have to be encoded?
How would it look like if it were for an SVG file?