forked from Lesin/reposync
31 lines
657 B
Python
31 lines
657 B
Python
import requests
|
|
import json
|
|
|
|
|
|
|
|
# GitHub创建issue的API URL
|
|
url = f"https://api.github.com/repos/fuxingtamu/yundingzhiyi/issues/2"
|
|
|
|
# 构造请求头
|
|
token = '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'
|
|
# 构造请求头
|
|
headers = {
|
|
'Authorization': f'token {token}',
|
|
'Accept': 'application/vnd.github+json'
|
|
}
|
|
|
|
# 发送POST请求
|
|
data = {
|
|
|
|
}
|
|
response = requests.get(url, headers=headers, json=data,verify=False)
|
|
issue = response.json()
|
|
print('title:',issue['title'])
|
|
print('body:',issue['body'])
|
|
print('number',issue['number'])#这个可以用来获取单个issue
|
|
print('id',issue['id'])
|
|
|
|
# 打印响应
|
|
#print(response.text)
|
|
# 检查响应状态码
|