To create a Gist using C# and the GitHub Gist API, we can follow these steps:
main.cs231 chars12 lines
main.cs204 chars10 lines
main.cs87 chars3 lines
main.cs31 chars2 lines
main.cs359 chars6 lines
main.cs190 chars4 lines
main.cs89 chars3 lines
Note that this example uses the JavaScriptSerializer
and HttpClient
classes from the System.Web.Extensions
and System.Net.Http
namespaces, respectively. If you're using .NET Core, you can use the System.Text.Json
and System.Net.Http.Json
classes instead.
Also, don't forget to replace "YOUR_ACCESS_TOKEN" with your actual GitHub personal access token.
gistlibby LogSnag