예. Github API V3 문서에서
: 기본 인증 또는 OAuth를를 사용하여 요청을
, 당신은 시간 당 5,000 요청을 만들 수 있습니다. 인증되지 않은 요청의 경우 속도 제한으로 시간당 최대 60 건의 요청을 처리 할 수 있습니다. 내가 만든 예를 들어 여기에
POST /gists
있어 :
<?php
if (isset($_POST['button']))
{
$code = $_POST['code'];
# Creating the array
$data = array(
'description' => 'description for your gist',
'public' => 1,
'files' => array(
'foo.php' => array('content' => 'sdsd'),
),
);
$data_string = json_encode($data);
# Sending the data using cURL
$url = 'https://api.github.com/gists';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
# Parsing the response
$decoded = json_decode($response, TRUE);
$gistlink = $decoded['html_url'];
echo $gistlink;
}
?>
<form action="" method="post">
Code:
<textarea name="code" cols="25" rows="10"/> </textarea>
<input type="submit" name="button"/>
</form>
자세한 내용은 documentation 참조를 다음과 같이
는 요점을 만들기 위해, 당신은
POST
요청을 보낼 수 있습니다.
나는 [인증되지 않은 속도 제한 요청] (http://developer.github.com/v3/#unauthenticated-rate-limited-requests) 카테고리에 속하는 인증되지 않은 요지를 생성하는 것이 확실합니다. –