Skip to content

Instantly share code, notes, and snippets.

@davidhund
Created October 1, 2011 11:49
Show Gist options
  • Save davidhund/1255933 to your computer and use it in GitHub Desktop.
Save davidhund/1255933 to your computer and use it in GitHub Desktop.
Create a Gist (of 2 files) through the GitHub API with cUrl
# Create a Gist (of 2 files) through the GitHub API
# ..uses cUrl but could of course also be done through PHP etc.
curl -H "Content-Type: application/json" -d '{"description": "Your XPATHr Gist test","public": true,"files": {"test.xml": {"content": "Paste your XML code.."},"test.xsl": {"content": "Paste your XSL code here.."}}}' 'https://api.github.com/gists'
@davidhund
Copy link
Author

So, Alpacaaa [sh|c]ould integrate this on http://alpacaaa.net/xpathr/

@jeremy-donson
Copy link

jeremy-donson commented May 13, 2021

$ curl -H "Content-Type: application/json" -d '{"description": "Your XPATHr Gist test","public": true,"files": {"test.xml": {"content": "Paste your XML code.."},"test.xsl": {"content": "Paste your XSL code here.."}}}' 'https://api.github.com/gists'
{
  "message": "Requires authentication",
  "documentation_url": "https://docs.github.com/rest/reference/gists#create-a-gist"
}
$ 

Had we instead created a new gist, then we would see it at: https://gist.github.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment