解析JSON的400个问题-使用OAuth的GitHub API和POSTMAN [英] 400 Problems parsing JSON - GitHub API and POSTMAN using OAuth

查看:166
本文介绍了解析JSON的400个问题-使用OAuth的GitHub API和POSTMAN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过GitHub API在我的私有仓库中创建一个文件.
https://developer.github.com/v3/repos/contents /#create-a-file

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

我正在使用Postman进行测试,并且已经通过OAuth进行了授权.

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==

错误消息是:问题解析JSON"

The error message is: "Problems parsing JSON"

但是问题到底出在哪里?

But where exactly is the problem?

推荐答案

我认为您必须使用body / binary中的choose file.我在github上创建问题时遇到了同样的问题.将属性放在body / raw / json中可以解决此问题.

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.

这篇关于解析JSON的400个问题-使用OAuth的GitHub API和POSTMAN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆