0

I want to create a file in my private Repo via the GitHub API.
https://developer.github.com/v3/repos/contents/#create-a-file

PUT /repos/:owner/:repo/contents/:path

I'm using Postman for testing and also already authorized via OAuth.

https://api.github.com/repos/user/reponame/contents/test.txt?message=Myfirstmessage&content=SGVsbG8gV29ybGQgaW4gQmFzZTY0IQ==

The error message is: "Problems parsing JSON"

But where exactly is the problem?

Screenshot of my situation

1
  • You are sending the data as a GET parameters, send it as the request body of a PUT request as stated in the docs. Also make sure your data is a valid json object. Commented Apr 21, 2019 at 11:48

1 Answer 1

3

I think you have to use choose file from body / binary. I've just had the same problem with creating an issue on github. Putting attributes in body / raw / json solved the problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.