Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Mariatta
Copy link
Member

When the content-type is passed, the raw body is used in the request.
The default content-type is json, and the body would be parsed to JSON format.

Updated documentation and changelog.

Closes #115

When the content-type is passed, the raw body is used in the request.
The default content-type is json, and the body would be parsed to JSON format.

Updated documentation and changelog.

Closes #115
@codecov
Copy link

codecov bot commented Aug 18, 2020

Codecov Report

Merging #131 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #131   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          391       395    +4     
  Branches        73        74    +1     
=========================================
+ Hits           391       395    +4     
Impacted Files Coverage Δ
gidgethub/abc.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e751664...9923dc5. Read the comment docs.

@Mariatta
Copy link
Member Author

I've tested by uploading a zip file to my test repo's release :

        with aiohttp.MultipartWriter("mixed") as mpwriter:
            mpwriter.append(open("/Users/mariatta/Downloads/old-release.zip", "rb"))
        upload_response = await gh.post(
            upload_url,
            url_vars={"name": "my test name", "label": "my label"},
            data=mpwriter,
            content_type="application/zip",
        )

@brettcannon brettcannon self-requested a review August 20, 2020 20:29
Copy link
Collaborator

@brettcannon brettcannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the API can be simplified by defaulting to "application/json" since it's the most common content-type for this. If you disagree then feel free to submit the PR as-is. I also have a comment setting the content-length regardless of content-type.

Otherwise LGTM!

Mariatta and others added 6 commits August 21, 2020 14:02
@Mariatta Mariatta merged commit 27c104d into master Aug 23, 2020
@Mariatta Mariatta deleted the issue-115 branch August 23, 2020 04:14
@Mariatta
Copy link
Member Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support specifying the content-type

3 participants