我使用 Postman 创建一个 gist 并在授权选项卡中添加了不记名令牌,但它假设创建一个 gist 并返回201 Created相反它返回 200 OK 并且它没有创建任何内容 在此处输入图像描述
我在请求正文中写了 GitHub Docs 中提到的示例以创建 Gist
{
"description": "Hello World Examples",
"public": true,
"files": {
"hello_world.rb": {
"content": "class HelloWorld\n def initialize(name)\n @name = name.capitalize\n end\n def sayHi\n puts \"Hello !\"\n end\nend\n\nhello = HelloWorld.new(\"World\")\nhello.sayHi"
},
"hello_world.py": {
"content": "class HelloWorld:\n\n def __init__(self, name):\n self.name = name.capitalize()\n \n def sayHi(self):\n print \"Hello \" + self.name + \"!\"\n\nhello = HelloWorld(\"world\")\nhello.sayHi()"
},
"hello_world_ruby.txt": {
"content": "Run `ruby hello_world.rb` to print Hello World"
},
"hello_world_python.txt": {
"content": "Run `python hello_world.py` to print Hello World"
}
}
}