Curl PUT is not working as expected for updating branch protection on github

I have created a temporary repository named testingProtectedBranch found here for testing the creation of protected branches in github by using curl . Here is the command I used for the purpose,but it is not working. I tried to find the error for about 2 hours but still I couldn't find it. Can anyone help me to find what is wrong in this command. Thanks in advance

curl -X PUT -H "Accept:application/vnd.github.loki-preview+json" -d '{"required_status_checks": {"include_admins": true,"strict": true,"contexts": ["continuous-integration/travis-ci"]},"required_pull_request_reviews": {"include_admins": false},"restrictions": {"users": ["octocat"],"teams": ["justice-league"]}}' https://api.github.com/repos/kasunsiyambalapitiya/testingProtectedBranch/branches/master/protection

Update with -vv

  • Trying 192.30.253.117...
  • Connected to api.github.com (192.30.253.117) port 443 (#0)
  • found 173 certificates in /etc/ssl/certs/ca-certificates.crt
  • found 697 certificates in /etc/ssl/certs
  • ALPN, offering http/1.1
  • SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
  • server certificate verification OK
  • server certificate status verification SKIPPED
  • common name: *.github.com (matched)
  • server certificate expiration date OK
  • server certificate activation date OK
  • certificate public key: RSA
  • certificate version: #3
  • subject: C=US,ST=California,L=San Francisco,O=GitHub, Inc.,CN=*.github.com
  • start date: Tue, 08 Apr 2014 00:00:00 GMT
  • expire date: Wed, 12 Apr 2017 12:00:00 GMT
  • issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 High Assurance Server CA
  • compression: NULL
  • ALPN, server accepted to use http/1.1

     PUT /repos/kasunsiyambalapitiya/testingProtectedBranch/branches/master/protection HTTP/1.1
     Host: api.github.com
     User-Agent: curl/7.47.0
     Accept:application/vnd.github.loki-preview+json
     Content-Length: 217
     Content-Type: application/x-www-form-urlencoded
    
  • upload completely sent off: 217 out of 217 bytes < HTTP/1.1 404 Not Found < Server: GitHub.com < Date: Wed, 11 Jan 2017 12:45:54 GMT < Content-Type: application/json; charset=utf-8 < Content-Length: 87 < Status: 404 Not Found < X-RateLimit-Limit: 60 < X-RateLimit-Remaining: 58 < X-RateLimit-Reset: 1484141537 < X-GitHub-Media-Type: github.loki-preview; format=json < Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval < Access-Control-Allow-Origin: * < Content-Security-Policy: default-src 'none' < Strict-Transport-Security: max-age=31536000; includeSubdomains; preload < X-Content-Type-Options: nosniff < X-Frame-Options: deny < X-XSS-Protection: 1; mode=block < X-GitHub-Request-Id: CB5E5F06:772E:59404EA:58762901 < { "message": "Not Found", "documentation_url": "https://developer.github.com/v3" }
  • Connection #0 to host api.github.com left intact
  • 链接地址: http://www.djcxy.com/p/48978.html

    上一篇: Git:如何忽略快进和恢复原点[分支]提前提交?

    下一篇: Curl PUT不能像预期的那样在github上更新分支保护