"Problems Parsing Json" when trying to create a new repository using Curl

I am getting the error “Problems parsing JSON” when trying to create a new repository using curl

The token I have put there is just for the example

curl -i -H "Authorization: token 123" \
>     -d '{ \
>         "name": “Abul”, \
>         "auto_init": true, \
>         "private": true, \
>         "gitignore_template": "nanoc" \
>       }' \
>     https://api.github.com/user/repos

When I run it I get a 400 bad request error and

HTTP/1.1 400 Bad Request
Date: Thu, 05 Nov 2020 16:04:05 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 159
Server: GitHub.com
Status: 400 Bad Request
X-OAuth-Scopes: repo
X-Accepted-OAuth-Scopes: public_repo, repo
X-GitHub-Media-Type: github.v3; format=json
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4992
X-RateLimit-Reset: 1604595503
X-RateLimit-Used: 8
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
Vary: Accept-Encoding, Accept, X-Requested-With
X-GitHub-Request-Id: D7A5:1B6F:FFDFE70:1253AAE0:5FA42275

  "message": "Problems parsing JSON",
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user"

Hey there @abul91 :wave:

Welcome to our Community, and thank you for posting! So the relevant documentation for this is found here:

And the example shows:

curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/user/repos \
  -d '{"name":"name"}'

Note the lack of whitespace in the example JSON.

Would you mind trying again, after adjusting your JSON values to exclude the whitespace between the "name":"value"'?

That should do it but I’m curious if you continue to run into issues. :bow: