rross
rross

Reputation: 2276

Github returns "Problems parsing JSON" when trying to create repo using curl

I'm attempting to create a repo on github using curl. No matter how I attempt to format my JSON it always returns "Problems parsing JSON". Is there something I'm missing? Here is my statement:

curl --data '{"name":"newRepoName"}' -XPOST -u username:password http://giturl

Upvotes: 7

Views: 4535

Answers (2)

mayankSinha
mayankSinha

Reputation: 160

Try including your token or password like this

  curl --data '{"name":"testrepo"}' \
       -X POST -u username:$TOKEN \
       https://api.github.com/user/repos

Upvotes: 0

Ivan Zuzak
Ivan Zuzak

Reputation: 18772

Strange since it works for me. Are you using the correct GitHub API endpoint (/user/repos)?

curl --data '{"name":"testrepo"}' -X POST -u username https://api.github.com/user/repos

Upvotes: 2

Related Questions