Create Github gist using file, with Gist API

I am attempting to make a github gist using the following command

curl -X POST -d '{"public":true,"files":{"test.txt":{"content":"String file contents"}}}' -u mgarciaisaia:mypassword https://api.github.com/gists

How should I edit the command such that it uploads a file on my local computer to the new gist, instead of taking content in a string from the command line?



Read more here: https://stackoverflow.com/questions/68460308/create-github-gist-using-file-with-gist-api

Content Attribution

This content was originally published by Norman at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: