Skip to content

Endpoint for uploading a Raw File #31682

Open
@shrik450

Description

@shrik450

Feature Description

There is already an endpoint for downloading raw files, i.e. the binary content of the file directly from the server: GET /repos/{owner}/{repo}/raw/{filepath}

However, to change or upload files, you must use the content APIs which require you to base64 encode the file first and then submit it via a JSON request. With files larger than a megabyte, the overhead of base64 encoding the file starts to become untenable, and doing so while streaming a file is non-trivial. This is especially an issue because the files you'd want to automatically upload via the API tend to be large.

I think there should be a counterpart to the raw file GET API that allows uploading the binary content of a file directly as a FormData instead. Ideally, this could just be POST /repos/{owner}/{repo}/raw/{filepath}.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/apiConcerns mainly the APItype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions