Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Github Gist中的个人访问令牌_Github_Github Api_Gist - Fatal编程技术网

Github Gist中的个人访问令牌

Github Gist中的个人访问令牌,github,github-api,gist,Github,Github Api,Gist,我已经创建了一个个人访问令牌(),提供Gistperms 我试图用它来创造一个要点,但我得到了 { "message": "Not Found", "documentation_url": "https://developer.github.com/v3" } 我的要求是: POST /gist HTTP/1.1 Host: api.github.com Connection: close X-Client-Data: CJO2yQEIorbJAQjBtskBCPqcygEIqZ3KA

我已经创建了一个个人访问令牌(),提供
Gist
perms

我试图用它来创造一个要点,但我得到了

{
  "message": "Not Found",
  "documentation_url": "https://developer.github.com/v3"
}
我的要求是:

POST /gist HTTP/1.1
Host: api.github.com
Connection: close
X-Client-Data: CJO2yQEIorbJAQjBtskBCPqcygEIqZ3KAQjSncoBCKijygE=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Accept-Language: en-US,en;q=0.8,es;q=0.6
Authorization: Basic blablablablablabla
Content-Length: 142

{
  "description": "the description for this gist",
  "files": {
    "file1.txt": {
      "content": "String file contents"
    }
  }
}

不能使用个人令牌在gist中发布吗?

问题是不应该使用基本身份验证,而应该使用特定的头来提供令牌。请求应为:

POST /gist HTTP/1.1
Host: api.github.com
Connection: close
X-Client-Data: CJO2yQEIorbJAQjBtskBCPqcygEIqZ3KAQjSncoBCKijygE=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Accept-Language: en-US,en;q=0.8,es;q=0.6
Authorization: token aabbaabbaabbabababababababababababababab
Content-Length: 142  

{
  "description": "the description for this gist",
  "files": {
    "file1.txt": {
      "content": "String file contents"
    }
  }
}