400 Problems parsing JSON - GitHub API and POSTMAN using OAuth

扶醉桌前 提交于 2019-12-25 03:53:53

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/33487136/400-problems-parsing-json-github-api-and-postman-using-oauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!