Repository: PyGithub/PyGithub

Issue:
Allow setting `name` for upload_asset
Currently, PyGithub uses `path.basename` for the `name` of the file assets -- could it be added that I can choose my own name? I can of course rename the file before upload, but it would be easier if I could just specify the name.


Discussion:
Hi, can you provide a more detailed example?
I have a local file called "build.xpi" that I want to upload as an asset named (not just labeled) "build-1234.xpi",bit I do not want to rename it locally before upload (other build stages rely on it being named build.xpi)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.


Resolving patch:
diff --git a/github/GitRelease.py b/github/GitRelease.py
--- a/github/GitRelease.py
+++ b/github/GitRelease.py
@@ -216,20 +216,24 @@ def update_release(self, name, message, draft=False, prerelease=False,
         )
         return github.GitRelease.GitRelease(self._requester, headers, data, completed=True)
 
-    def upload_asset(self, path, label="", content_type=""):
+    def upload_asset(self, path, label="", content_type=github.GithubObject.NotSet, name=github.GithubObject.NotSet):
         """
-        :calls: `POST https://<upload_url>/repos/:owner/:repo/releases/:release_id/assets?name=foo.zip <https://developer.github.com/v3/repos/releases/#upload-a-release-asset>`_
+        :calls: `POST https://<upload_url>/repos/:owner/:repo/releases/:release_id/assets <https://developer.github.com/v3/repos/releases/#upload-a-release-asset>`_
         :rtype: :class:`github.GitReleaseAsset.GitReleaseAsset`
         """
         assert isinstance(path, (str, unicode)), path
         assert isinstance(label, (str, unicode)), label
+        assert name is github.GithubObject.NotSet or isinstance(name, (str, unicode)), name
 
         post_parameters = {
-            "name": basename(path),
             "label": label
         }
+        if name is github.GithubObject.NotSet:
+            post_parameters["name"] = basename(path)
+        else:
+            post_parameters["name"] = name
         headers = {}
-        if len(content_type) > 0:
+        if content_type is not github.GithubObject.NotSet:
             headers["Content-Type"] = content_type
         resp_headers, data = self._requester.requestBlobAndCheck(
             "POST",


Test patch:
diff --git a/tests/GitRelease.py b/tests/GitRelease.py
--- a/tests/GitRelease.py
+++ b/tests/GitRelease.py
@@ -150,3 +150,10 @@ def testUploadAsset(self):
         the_release.upload_asset(self.artifact_path,
                                  "unit test artifact",
                                  "application/zip")
+
+    def testUploadAssetWithName(self):
+        release_id = 1210837
+        repo = self.g.get_user().get_repo("PyGithub")
+        release = repo.get_release(release_id)
+        r = release.upload_asset(self.artifact_path, name="foobar.zip")
+        self.assertEqual(r.name, "foobar.zip")
diff --git a/tests/ReplayData/Release.testUploadAssetWithName.txt b/tests/ReplayData/Release.testUploadAssetWithName.txt
new file mode 100644
--- /dev/null
+++ b/tests/ReplayData/Release.testUploadAssetWithName.txt
@@ -0,0 +1,43 @@
+https
+GET
+api.github.com
+None
+/user
+{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
+None
+200
+[('content-length', '1220'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'a30e6f9aa7cf5731b87dfb3b9992202d'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"a692daa1e912efb3a9048cdbae74bf02"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4947'), ('x-github-media-type', 'github.v3; 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'), ('x-github-request-id', '56BCFFD3:5678:6306D35:553A03F2'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('last-modified', 'Thu, 23 Apr 2015 15:34:48 GMT'), ('date', 'Fri, 24 Apr 2015 08:50:59 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1429867683')]
+{"login":"edhollandAL","id":11922660,"avatar_url":"https://avatars.githubusercontent.com/u/11922660?v=3","gravatar_id":"","url":"https://api.github.com/users/edhollandAL","html_url":"https://github.com/edhollandAL","followers_url":"https://api.github.com/users/edhollandAL/followers","following_url":"https://api.github.com/users/edhollandAL/following{/other_user}","gists_url":"https://api.github.com/users/edhollandAL/gists{/gist_id}","starred_url":"https://api.github.com/users/edhollandAL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edhollandAL/subscriptions","organizations_url":"https://api.github.com/users/edhollandAL/orgs","repos_url":"https://api.github.com/users/edhollandAL/repos","events_url":"https://api.github.com/users/edhollandAL/events{/privacy}","received_events_url":"https://api.github.com/users/edhollandAL/received_events","type":"User","site_admin":false,"public_repos":3,"public_gists":0,"followers":0,"following":0,"created_at":"2015-04-13T09:58:53Z","updated_at":"2015-04-23T15:34:48Z","private_gists":0,"total_private_repos":0,"owned_private_repos":0,"disk_usage":0,"collaborators":0,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}
+
+https
+GET
+api.github.com
+None
+/repos/edhollandAL/PyGithub
+{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
+None
+200
+[('content-length', '13980'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '07ff1c8a09e44b62e277fae50a1b1dc4'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"354bfbe5bc3193b117028111f8d7bf5d"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4946'), ('x-github-media-type', 'github.v3; 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'), ('x-github-request-id', '56BCFFD3:5678:6306E14:553A03F3'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('last-modified', 'Thu, 23 Apr 2015 10:29:48 GMT'), ('date', 'Fri, 24 Apr 2015 08:50:59 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1429867683')]
+{"id":34449703,"name":"PyGithub","full_name":"edhollandAL/PyGithub","owner":{"login":"edhollandAL","id":11922660,"avatar_url":"https://avatars.githubusercontent.com/u/11922660?v=3","gravatar_id":"","url":"https://api.github.com/users/edhollandAL","html_url":"https://github.com/edhollandAL","followers_url":"https://api.github.com/users/edhollandAL/followers","following_url":"https://api.github.com/users/edhollandAL/following{/other_user}","gists_url":"https://api.github.com/users/edhollandAL/gists{/gist_id}","starred_url":"https://api.github.com/users/edhollandAL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edhollandAL/subscriptions","organizations_url":"https://api.github.com/users/edhollandAL/orgs","repos_url":"https://api.github.com/users/edhollandAL/repos","events_url":"https://api.github.com/users/edhollandAL/events{/privacy}","received_events_url":"https://api.github.com/users/edhollandAL/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edhollandAL/PyGithub","description":"Python library implementing the GitHub API v3","fork":true,"url":"https://api.github.com/repos/edhollandAL/PyGithub","forks_url":"https://api.github.com/repos/edhollandAL/PyGithub/forks","keys_url":"https://api.github.com/repos/edhollandAL/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edhollandAL/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edhollandAL/PyGithub/teams","hooks_url":"https://api.github.com/repos/edhollandAL/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/edhollandAL/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/edhollandAL/PyGithub/events","assignees_url":"https://api.github.com/repos/edhollandAL/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/edhollandAL/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/edhollandAL/PyGithub/tags","blobs_url":"https://api.github.com/repos/edhollandAL/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edhollandAL/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edhollandAL/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/edhollandAL/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edhollandAL/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/edhollandAL/PyGithub/languages","stargazers_url":"https://api.github.com/repos/edhollandAL/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/edhollandAL/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/edhollandAL/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/edhollandAL/PyGithub/subscription","commits_url":"https://api.github.com/repos/edhollandAL/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/edhollandAL/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/edhollandAL/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/edhollandAL/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/edhollandAL/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/edhollandAL/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edhollandAL/PyGithub/merges","archive_url":"https://api.github.com/repos/edhollandAL/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edhollandAL/PyGithub/downloads","issues_url":"https://api.github.com/repos/edhollandAL/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/edhollandAL/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/edhollandAL/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/edhollandAL/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edhollandAL/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/edhollandAL/PyGithub/releases{/id}","created_at":"2015-04-23T10:29:45Z","updated_at":"2015-04-23T10:29:48Z","pushed_at":"2015-04-15T20:53:42Z","git_url":"git://github.com/edhollandAL/PyGithub.git","ssh_url":"git@github.com:edhollandAL/PyGithub.git","clone_url":"https://github.com/edhollandAL/PyGithub.git","svn_url":"https://github.com/edhollandAL/PyGithub","homepage":"http://jacquev6.github.io/PyGithub","size":15962,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"parent":{"id":3544490,"name":"PyGithub","full_name":"PyGithub/PyGithub","owner":{"login":"PyGithub","id":11288996,"avatar_url":"https://avatars.githubusercontent.com/u/11288996?v=3","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PyGithub/PyGithub","description":"Python library implementing the GitHub API v3","fork":false,"url":"https://api.github.com/repos/PyGithub/PyGithub","forks_url":"https://api.github.com/repos/PyGithub/PyGithub/forks","keys_url":"https://api.github.com/repos/PyGithub/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyGithub/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyGithub/PyGithub/teams","hooks_url":"https://api.github.com/repos/PyGithub/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/PyGithub/PyGithub/events","assignees_url":"https://api.github.com/repos/PyGithub/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/PyGithub/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/PyGithub/PyGithub/tags","blobs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyGithub/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/PyGithub/PyGithub/languages","stargazers_url":"https://api.github.com/repos/PyGithub/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/PyGithub/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/PyGithub/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/PyGithub/PyGithub/subscription","commits_url":"https://api.github.com/repos/PyGithub/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/PyGithub/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyGithub/PyGithub/merges","archive_url":"https://api.github.com/repos/PyGithub/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyGithub/PyGithub/downloads","issues_url":"https://api.github.com/repos/PyGithub/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/PyGithub/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/PyGithub/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/PyGithub/PyGithub/releases{/id}","created_at":"2012-02-25T12:53:47Z","updated_at":"2015-04-23T16:36:27Z","pushed_at":"2015-04-15T20:53:42Z","git_url":"git://github.com/PyGithub/PyGithub.git","ssh_url":"git@github.com:PyGithub/PyGithub.git","clone_url":"https://github.com/PyGithub/PyGithub.git","svn_url":"https://github.com/PyGithub/PyGithub","homepage":"http://jacquev6.github.io/PyGithub","size":15962,"stargazers_count":579,"watchers_count":579,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":160,"mirror_url":null,"open_issues_count":28,"forks":160,"open_issues":28,"watchers":579,"default_branch":"master"},"source":{"id":3544490,"name":"PyGithub","full_name":"PyGithub/PyGithub","owner":{"login":"PyGithub","id":11288996,"avatar_url":"https://avatars.githubusercontent.com/u/11288996?v=3","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PyGithub/PyGithub","description":"Python library implementing the GitHub API v3","fork":false,"url":"https://api.github.com/repos/PyGithub/PyGithub","forks_url":"https://api.github.com/repos/PyGithub/PyGithub/forks","keys_url":"https://api.github.com/repos/PyGithub/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyGithub/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyGithub/PyGithub/teams","hooks_url":"https://api.github.com/repos/PyGithub/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/PyGithub/PyGithub/events","assignees_url":"https://api.github.com/repos/PyGithub/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/PyGithub/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/PyGithub/PyGithub/tags","blobs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyGithub/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/PyGithub/PyGithub/languages","stargazers_url":"https://api.github.com/repos/PyGithub/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/PyGithub/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/PyGithub/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/PyGithub/PyGithub/subscription","commits_url":"https://api.github.com/repos/PyGithub/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/PyGithub/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyGithub/PyGithub/merges","archive_url":"https://api.github.com/repos/PyGithub/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyGithub/PyGithub/downloads","issues_url":"https://api.github.com/repos/PyGithub/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/PyGithub/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/PyGithub/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/PyGithub/PyGithub/releases{/id}","created_at":"2012-02-25T12:53:47Z","updated_at":"2015-04-23T16:36:27Z","pushed_at":"2015-04-15T20:53:42Z","git_url":"git://github.com/PyGithub/PyGithub.git","ssh_url":"git@github.com:PyGithub/PyGithub.git","clone_url":"https://github.com/PyGithub/PyGithub.git","svn_url":"https://github.com/PyGithub/PyGithub","homepage":"http://jacquev6.github.io/PyGithub","size":15962,"stargazers_count":579,"watchers_count":579,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":160,"mirror_url":null,"open_issues_count":28,"forks":160,"open_issues":28,"watchers":579,"default_branch":"master"},"network_count":160,"subscribers_count":1}
+
+https
+GET
+api.github.com
+None
+/repos/edhollandAL/PyGithub/releases/1210837
+{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
+None
+200
+[('content-length', '1632'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '139317cebd6caf9cd03889139437f00b'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"26708914904a29b8c9fd2ac006beb9db"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4942'), ('x-github-media-type', 'github.v3; 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'), ('x-github-request-id', '56BCFFD3:5677:5265FA1:553A03F5'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('last-modified', 'Fri, 24 Apr 2015 08:43:32 GMT'), ('date', 'Fri, 24 Apr 2015 08:51:01 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1429867683')]
+{"url":"https://api.github.com/repos/edhollandAL/PyGithub/releases/1210837","assets_url":"https://api.github.com/repos/edhollandAL/PyGithub/releases/1210837/assets","upload_url":"https://uploads.github.com/repos/edhollandAL/PyGithub/releases/1210837/assets{?name}","html_url":"https://github.com/edhollandAL/PyGithub/releases/tag/v1.25.2","id":1210837,"tag_name":"v1.25.2","target_commitish":"master","name":"Test","draft":false,"author":{"login":"edhollandAL","id":11922660,"avatar_url":"https://avatars.githubusercontent.com/u/11922660?v=3","gravatar_id":"","url":"https://api.github.com/users/edhollandAL","html_url":"https://github.com/edhollandAL","followers_url":"https://api.github.com/users/edhollandAL/followers","following_url":"https://api.github.com/users/edhollandAL/following{/other_user}","gists_url":"https://api.github.com/users/edhollandAL/gists{/gist_id}","starred_url":"https://api.github.com/users/edhollandAL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edhollandAL/subscriptions","organizations_url":"https://api.github.com/users/edhollandAL/orgs","repos_url":"https://api.github.com/users/edhollandAL/repos","events_url":"https://api.github.com/users/edhollandAL/events{/privacy}","received_events_url":"https://api.github.com/users/edhollandAL/received_events","type":"User","site_admin":false},"prerelease":false,"created_at":"2014-10-08T01:54:00Z","published_at":"2015-04-24T08:43:32Z","assets":[],"tarball_url":"https://api.github.com/repos/edhollandAL/PyGithub/tarball/v1.25.2","zipball_url":"https://api.github.com/repos/edhollandAL/PyGithub/zipball/v1.25.2","body":"Body"}
+
+https
+POST
+uploads.github.com
+None
+/repos/edhollandAL/PyGithub/releases/1210837/assets?label=&name=foobar.zip
+{'Authorization': 'Basic login_and_password_removed', 'Content-Length': '140', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/zip'}
+None
+201
+[('content-length', '155'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '139317cebd6caf9cd03889139437f00b'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"26708914904a29b8c9fd2ac006beb9db"'), ('access-control-allow-credentials', 'true'), ('status', '201 CREATED'), ('x-ratelimit-remaining', '4942'), ('x-github-media-type', 'github.v3; 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'), ('x-github-request-id', '56BCFFD3:5677:5265FA1:553A03F5'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('last-modified', 'Fri, 24 Jun 2019 04:23:32 GMT'), ('date', 'Fri, 24 Jun 2019 04:29:01 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/zip'), ('x-ratelimit-reset', '1429867683')]
+{"url":"/repos/edhollandAL/PyGithub/releases/1210837/assets/xxx","id":"xxx","name":"foobar.zip","label":"","uploader":"unittests"}