today-i-learned
  • Today I Learned
  • JavaScript
    • fetch
  • Etc
    • Chrome Extension 개발
    • Github API
    • 트러블슈팅
  • AMP
    • AMP CORS
  • React
    • Accessibility (WIP)
    • Higher-Order Components (WIP)
Powered by GitBook
On this page
  • 개인 토큰 발급 받는 곳
  • 이슈 생성 하는 법

Was this helpful?

  1. Etc

Github API

PreviousChrome Extension 개발Next트러블슈팅

Last updated 6 years ago

Was this helpful?

개인 토큰 발급 받는 곳

이슈 생성 하는 법

  • url 생성

    • ex)

1) curl로 이슈 생성하기

curl -X POST -i -u {id}:{token} -d \
'{"title" : "제목이요!", "body" : "내용이요!"}'
https://github.com/api/v3/repos/{organization}/{project}/issues

2) node https 모듈을 이용해서 이슈 생성하기

const https = require('https');
const issue = {
    title : '제목이요!',
    body : '내용이요'
};

const req = https.request({
  host: 'github.com',
  method: 'POST',
  port: 443,
  path: '/api/v3/repos/{organization}/{project}/issues',
  headers: {
    'Accept': 'application/vnd.github.symmetra-preview+json',
    'Authorization': 'token {token}'
  }
}, res => {
  let data = '';
  res.on('data', chunk => data += chunk);
  res.on('end', () => console.log(JSON.parse(data)));
});

req.write(JSON.stringify(issue));
req.on('error', e => console.log('error', e));
req.end();
https://github.com/settings/tokens
https://github.com/api/v3/repos/{organization}/{project}/issues
https://github.com/api/v3/repos/tidyline/til/issues