snaggs
snaggs

Reputation: 5713

Fail to upload binaries to GitHub with curl

I try to upload binaries to GitHub specific tag from CLI.

Regards to DOCS:https://developer.github.com/v3/repos/releases/

For now I try to use curl but it fails:

curl -H "Authorization: token faa1217373f025abf8a683539e00ce98694c17da" \
     -H "Content-Type: multipart/form-data;" \
     -H "Content-Type: application/zip" \
     --data-binary @Tracker.framework.zip \   "https://uploads.github.com/repos/SDK/FWTestBuild/releases/tag/1.2.27/assets?name=Tracker.framework.zip"
--verbose

but get error:

*   Trying 192.30.253.96...
* Connected to uploads.github.com (192.30.253.96) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.github.com
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> POST /repos/SDK/FWTestBuild/releases/tag/1.2.27/assets?name=Tracker.framework.zip HTTP/1.1
> Host: uploads.github.com
> User-Agent: curl/7.49.1
> Accept: */*
> Authorization: token faa1217373f025abf8a683539e00ce98694c17da
> Content-Type: multipart/form-data;
> Content-Type: application/zip
> Content-Length: 739956
> Expect: 100-continue
> 
< HTTP/1.1 500 Internal Server Error
< Access-Control-Allow-Origin: *
< Content-Length: 64
< Content-Security-Policy: default-src 'none'
< Content-Type: application/json
< Strict-Transport-Security: max-age=31557600
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Xss-Protection: 1; mode=block
< Date: Tue, 13 Dec 2016 15:39:26 GMT
< X-GitHub-Request-Id: 1FA8AE8E:1A14:2E0DCC:5850162D
* HTTP error before end of send, stop sending
< 
* Closing connection 0
{"message":"Error","request_id":"1FA8AE8E:1A14:2E0DCC:5850162D"}

Upvotes: 0

Views: 131

Answers (1)

Vic
Vic

Reputation: 110

Are you sure that your URI https://uploads.github.com/repos/SDK/FWTestBuild/releases/tag/1.2.27/assets?name=Tracker.framework.zip really corresponds to the template

https://<upload_url>/repos/:owner/:repo/releases/:id/assets?name=foo.zip

Pls. consider that the <upload_url> MUST be obtained from the "Get a single release" query to the API.

Upvotes: 1

Related Questions