Skip to content

How to upload a file using GitHub API #24723

Discussion options

You must be logged in to vote

It’s hard to write documentation that is both approachable but also has a good amount of detail to answer whatever questions that people will have.

So you’re going to need to understand a few things about the information in the create a file endpoint reference:

  • You’re going to need to be authenticated and have write permissions on the repository
  • You need to pass certain things in the URL and others in the body of the HTTP request
    • Replaceable parameters in the URL start with a colon :

I’m also going to be using HTTPie instead of curl because it makes JSON REST API interactions much easier. (And I was never very good at using curl for things 😀)

I used the following command:

http PUT h…

Replies: 8 suggested answers 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
1 reply
@rushikesh456thorat
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
8 participants