You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 1, 2017. It is now read-only.
HTTP spec. Let’s take a look at a few of them:</p>
112
112
113
113
<ul>
114
-
<li><code>X-GitHub-Media-Type</code> has a value of<code>github.beta</code>. This lets us know the<ahref="http://developer.github.com/v3/media/">media type</a>
114
+
<li>
115
+
<code>X-GitHub-Media-Type</code> has a value of<code>github.beta</code>. This lets us know the<ahref="http://developer.github.com/v3/media/">media type</a>
115
116
for the response. Media types have helped us version our output in API v3. We’ll
116
117
talk more about that later.</li>
117
118
<li>Take note of the<code>X-RateLimit-Limit</code> and<code>X-RateLimit-Remaining</code> headers. This
@@ -177,8 +178,10 @@ <h3 id="oauth">OAuth</h3>
177
178
features:</p>
178
179
179
180
<ul>
180
-
<li><strong>Revokable access</strong>: users can revoke authorization to third party apps at any time</li>
181
-
<li><strong>Limited access</strong>: users can review the specific access that a token
181
+
<li>
182
+
<strong>Revokable access</strong>: users can revoke authorization to third party apps at any time</li>
183
+
<li>
184
+
<strong>Limited access</strong>: users can review the specific access that a token
182
185
will provide before authorizing a third party app</li>
183
186
</ul>
184
187
@@ -187,7 +190,7 @@ <h3 id="oauth">OAuth</h3>
187
190
indicating the name of the app, as well as the level of access the app
188
191
has once it’s authorized by the user. After a user authorizes access, GitHub
189
192
redirects the user back to the application:
190
-
<imgsrc="/images/oauth_prompt.png"alt=""/></p>
193
+
<imgsrc="/images/oauth_prompt.png"alt=""></p>
191
194
192
195
<p>You don’t need to set up the entire web flow to begin working with OAuth tokens.
193
196
The<ahref="http://developer.github.com/v3/oauth/#oauth-authorizations-api">Authorizations API</a> makes it simple to use Basic Authentication
puts "#{username} made a comment on #{post_date}. It says:\n'#{content}'\n"
88
-
end
89
-
</code></pre>
87
+
<spanclass="nb">puts</span><spanclass="s2">"</span><spanclass="si">#{</span><spanclass="n">username</span><spanclass="si">}</span><spanclass="s2"> made a comment on</span><spanclass="si">#{</span><spanclass="n">post_date</span><spanclass="si">}</span><spanclass="s2">. It says:</span><spanclass="se">\n</span><spanclass="s2">'</span><spanclass="si">#{</span><spanclass="n">content</span><spanclass="si">}</span><spanclass="s2">'</span><spanclass="se">\n</span><spanclass="s2">"</span>
88
+
<spanclass="k">end</span></code></pre>
90
89
91
90
<p>Here, we’re specifically calling out to the Issues API to get the comments (<code>issue_comments</code>),
92
91
providing both the repository’s name (<code>octocat/Spoon-Knife</code>), and the Pull Request ID
<h2id="pull-request-comments-on-a-line">Pull Request Comments on a Line</h2>
97
96
98
97
<p>Within the diff view, you can start a discussion on a particular aspect of a singular
99
-
change made within the Pull Request. These comments occur on the individual lines
98
+
change made within the Pull Request. These comments occur on the individual lines
100
99
within a changed file. The endpoint URL for this discussion comes from<ahref="http://developer.github.com/v3/pulls/comments/">the Pull Request Review API</a>.</p>
101
100
102
101
<p>The following code fetches all the Pull Request comments made on files, given a single Pull Request number:</p>
puts "#{username} made a comment on #{post_date} for the file called #{path}, on line #{position}. It says:\n'#{content}'\n"
118
-
end
119
-
</code></pre>
116
+
<spanclass="nb">puts</span><spanclass="s2">"</span><spanclass="si">#{</span><spanclass="n">username</span><spanclass="si">}</span><spanclass="s2"> made a comment on</span><spanclass="si">#{</span><spanclass="n">post_date</span><spanclass="si">}</span><spanclass="s2"> for the file called</span><spanclass="si">#{</span><spanclass="n">path</span><spanclass="si">}</span><spanclass="s2">, on line</span><spanclass="si">#{</span><spanclass="n">position</span><spanclass="si">}</span><spanclass="s2">. It says:</span><spanclass="se">\n</span><spanclass="s2">'</span><spanclass="si">#{</span><spanclass="n">content</span><spanclass="si">}</span><spanclass="s2">'</span><spanclass="se">\n</span><spanclass="s2">"</span>
117
+
<spanclass="k">end</span></code></pre>
120
118
121
119
<p>You’ll notice that it’s incredibly similar to the example above. The difference
122
120
between this view and the Pull Request comment is the focus of the conversation.
puts "#{username} made a comment on #{post_date}. It says:\n'#{content}'\n"
147
-
end
148
-
</code></pre>
144
+
<spanclass="nb">puts</span><spanclass="s2">"</span><spanclass="si">#{</span><spanclass="n">username</span><spanclass="si">}</span><spanclass="s2"> made a comment on</span><spanclass="si">#{</span><spanclass="n">post_date</span><spanclass="si">}</span><spanclass="s2">. It says:</span><spanclass="se">\n</span><spanclass="s2">'</span><spanclass="si">#{</span><spanclass="n">content</span><spanclass="si">}</span><spanclass="s2">'</span><spanclass="se">\n</span><spanclass="s2">"</span>
145
+
<spanclass="k">end</span></code></pre>
149
146
150
147
<p>Note that this API call will retrieve single line comments, as well as comments made